Skip to content

Commit

Permalink
hw3
Browse files Browse the repository at this point in the history
  • Loading branch information
pankratov2010 committed May 21, 2023
1 parent f5c02a7 commit 1df12c4
Show file tree
Hide file tree
Showing 4 changed files with 46 additions and 2 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Project files
vendor
composer.lock
22 changes: 20 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,21 @@
# PHP_2023
# Процессор строк

https://otus.ru/lessons/razrabotchik-php/?utm_source=github&utm_medium=free&utm_campaign=otus
Краткое описание пакета.

## Требования

- PHP 7.4

## Установка

```bash
$ composer require dmitrykirillov/otus-composer-package
```

## Использование

```php
<?php
$processor = new StringProcessor();
echo $processor->getLength('my string'); // 9
```
10 changes: 10 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"name": "pankratov/hw3",
"type": "library",
"autoload": {
"psr-4": {
"Pankratov\\Hw3\\": "src/"
}
},
"require": {}
}
13 changes: 13 additions & 0 deletions src/StringProcessor.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<?php

declare(strict_types=1);

namespace Pankratov\Hw3;

class StringProcessor
{
public function getLength(string $s): int
{
return strlen($s);
}
}

0 comments on commit 1df12c4

Please sign in to comment.