Skip to content

Commit

Permalink
big refactoring tiempos
Browse files Browse the repository at this point in the history
  • Loading branch information
rodber committed Jan 24, 2022
1 parent 9410d2e commit 68ec80b
Show file tree
Hide file tree
Showing 620 changed files with 3,211 additions and 2,680 deletions.
14 changes: 7 additions & 7 deletions bin/chevere
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@
*/

use Ahc\Cli\IO\Interactor;
use Chevere\Components\Console\Application;
use Chevere\Components\Console\Commands\ControllerInspectCommand;
use Chevere\Components\Console\Commands\ControllerListCommand;
use Chevere\Components\Console\Commands\ControllerRunCommand;
use Chevere\Components\Instances\WritersInstance;
use Chevere\Components\Writer\Writers;
use function Chevere\Components\Filesystem\dirForString;
use Chevere\Console\Application;
use Chevere\Console\Commands\ControllerInspectCommand;
use Chevere\Console\Commands\ControllerListCommand;
use Chevere\Console\Commands\ControllerRunCommand;
use Chevere\Instances\WritersInstance;
use Chevere\Writer\Writers;
use function Chevere\Filesystem\dirForString;

foreach ([
__DIR__ . '/../../../../vendor/autoload.php',
Expand Down
30 changes: 14 additions & 16 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,24 +40,22 @@
},
"autoload": {
"files": [
"src/Chevere/Components/Filesystem/functions.php",
"src/Chevere/Components/Iterator/functions.php",
"src/Chevere/Components/Message/functions.php",
"src/Chevere/Components/Parameter/functions.php",
"src/Chevere/Components/Router/functions.php",
"src/Chevere/Components/Str/functions.php",
"src/Chevere/Components/ThrowableHandler/functions.php",
"src/Chevere/Components/Translator/functions.php",
"src/Chevere/Components/Type/functions.php",
"src/Chevere/Components/VarSupport/functions.php",
"src/Chevere/Components/VarDump/functions.php",
"src/Chevere/Components/Workflow/functions.php",
"src/Chevere/Components/Writer/functions.php"
"src/Filesystem/functions.php",
"src/Iterator/functions.php",
"src/Message/functions.php",
"src/Parameter/functions.php",
"src/Router/functions.php",
"src/Str/functions.php",
"src/ThrowableHandler/functions.php",
"src/Translator/functions.php",
"src/Type/functions.php",
"src/VarSupport/functions.php",
"src/VarDump/functions.php",
"src/Workflow/functions.php",
"src/Writer/functions.php"
],
"psr-4": {
"Chevere\\Components\\": "src/Chevere/Components/",
"Chevere\\Interfaces\\": "src/Chevere/Interfaces/",
"Chevere\\Exceptions\\": "src/Chevere/Exceptions/"
"Chevere\\": "src/"
}
},
"autoload-dev": {
Expand Down
2 changes: 1 addition & 1 deletion infection.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"$schema": "https://raw.githubusercontent.com/infection/infection/0.26.1/resources/schema.json",
"source": {
"directories": [
"src/Chevere/Components/"
"src/"
]
},
"logs": {
Expand Down
5 changes: 4 additions & 1 deletion phpunit-report.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,11 @@
processUncoveredFiles="true"
ignoreDeprecatedCodeUnits="true">
<include>
<directory suffix=".php">src/Chevere/</directory>
<directory suffix=".php">src/</directory>
</include>
<exclude>
<directory suffix=".php">src/**/Exceptions/</directory>
</exclude>
<report>
<clover outputFile="build/logs/clover.xml"/>
<html outputDirectory="build/logs/html" lowUpperBound="50" highLowerBound="90"/>
Expand Down
5 changes: 4 additions & 1 deletion phpunit.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,10 @@
processUncoveredFiles="true"
ignoreDeprecatedCodeUnits="true">
<include>
<directory suffix=".php">src/Chevere/Components/</directory>
<directory suffix=".php">src/</directory>
</include>
<exclude>
<directory suffix=".php">src/**/Exceptions/</directory>
</exclude>
</coverage>
</phpunit>
20 changes: 10 additions & 10 deletions src/Chevere/Components/Action/Action.php → src/Action/Action.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,16 @@

declare(strict_types=1);

namespace Chevere\Components\Action;

use Chevere\Components\Common\Traits\DescriptionTrait;
use Chevere\Components\Parameter\Arguments;
use Chevere\Components\Parameter\Parameters;
use Chevere\Components\Response\Response;
use Chevere\Interfaces\Action\ActionInterface;
use Chevere\Interfaces\Parameter\ArgumentsInterface;
use Chevere\Interfaces\Parameter\ParametersInterface;
use Chevere\Interfaces\Response\ResponseInterface;
namespace Chevere\Action;

use Chevere\Action\Interfaces\ActionInterface;
use Chevere\Common\Traits\DescriptionTrait;
use Chevere\Parameter\Arguments;
use Chevere\Parameter\Interfaces\ArgumentsInterface;
use Chevere\Parameter\Interfaces\ParametersInterface;
use Chevere\Parameter\Parameters;
use Chevere\Response\Interfaces\ResponseInterface;
use Chevere\Response\Response;

abstract class Action implements ActionInterface
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@

declare(strict_types=1);

namespace Chevere\Components\Action;
namespace Chevere\Action;

use Chevere\Interfaces\Action\ActionExecutedInterface;
use Chevere\Action\Interfaces\ActionExecutedInterface;
use Throwable;

final class ActionExecuted implements ActionExecutedInterface
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@

declare(strict_types=1);

namespace Chevere\Components\Action;
namespace Chevere\Action;

use Chevere\Interfaces\Action\ActionExecutedInterface;
use Chevere\Interfaces\Action\ActionRunnerInterface;
use Chevere\Interfaces\Controller\ControllerInterface;
use Chevere\Action\Interfaces\ActionExecutedInterface;
use Chevere\Action\Interfaces\ActionRunnerInterface;
use Chevere\Controller\Interfaces\ControllerInterface;
use Throwable;

final class ActionRunner implements ActionRunnerInterface
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

declare(strict_types=1);

namespace Chevere\Interfaces\Action;
namespace Chevere\Action\Interfaces;

use Throwable;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@

declare(strict_types=1);

namespace Chevere\Interfaces\Action;
namespace Chevere\Action\Interfaces;

use Chevere\Interfaces\Common\DescriptionInterface;
use Chevere\Interfaces\Parameter\ArgumentsInterface;
use Chevere\Interfaces\Parameter\ParametersInterface;
use Chevere\Interfaces\Response\ResponseInterface;
use Chevere\Common\Interfaces\DescriptionInterface;
use Chevere\Parameter\Interfaces\ArgumentsInterface;
use Chevere\Parameter\Interfaces\ParametersInterface;
use Chevere\Response\Interfaces\ResponseInterface;

/**
* Describes the component in charge of defining a single action.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@

declare(strict_types=1);

namespace Chevere\Interfaces\Action;
namespace Chevere\Action\Interfaces;

use Chevere\Interfaces\Controller\ControllerInterface;
use Chevere\Controller\Interfaces\ControllerInterface;

/**
* Describes the component in charge of running the controller.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@

declare(strict_types=1);

namespace Chevere\Components\Attribute;
namespace Chevere\Attribute;

use Attribute;
use Chevere\Interfaces\Attribute\AttributeInterface;
use Chevere\Attribute\Interfaces\AttributeInterface;

#[Attribute]
abstract class BaseAttribute implements AttributeInterface
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

declare(strict_types=1);

namespace Chevere\Components\Attribute;
namespace Chevere\Attribute;

use Attribute;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

declare(strict_types=1);

namespace Chevere\Interfaces\Attribute;
namespace Chevere\Attribute\Interfaces;

/**
* Describes the component in charge of defining an attribute.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

declare(strict_types=1);

namespace Chevere\Components\Attribute;
namespace Chevere\Attribute;

use Attribute;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@

declare(strict_types=1);

namespace Chevere\Components\Benchmark;
namespace Chevere\Benchmark;

use Chevere\Components\Message\Message;
use Chevere\Exceptions\Core\ArgumentCountException;
use Chevere\Exceptions\Core\OverflowException;
use Chevere\Interfaces\Benchmark\BenchmarkInterface;
use Chevere\Benchmark\Interfaces\BenchmarkInterface;
use Chevere\Message\Message;
use Chevere\Throwable\Errors\ArgumentCountError;
use Chevere\Throwable\Exceptions\OverflowException;
use Ds\Set;
use ReflectionFunction;

Expand Down Expand Up @@ -92,7 +92,7 @@ private function assertCallableArgumentsCount(string $name): void
{
$parametersCount = $this->reflection->getNumberOfParameters();
if ($this->argumentsCount !== $parametersCount) {
throw new ArgumentCountException(
throw new ArgumentCountError(
(new Message('Instance of %className% was constructed to handle callables with %argumentsCount% arguments, %parametersCount% parameters declared for callable named %callableName%'))
->code('%className%', __CLASS__)
->code('%argumentsCount%', (string) $this->argumentsCount)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,20 +11,18 @@

declare(strict_types=1);

namespace Chevere\Components\Benchmark;

use ArgumentCountError;
use Chevere\Components\HrTime\HrTime;
use Chevere\Components\Message\Message;
use Chevere\Exceptions\Core\ArgumentCountException;
use Chevere\Exceptions\Core\InvalidArgumentException;
use Chevere\Exceptions\Core\TypeException;
use Chevere\Interfaces\Benchmark\BenchmarkInterface;
use Chevere\Interfaces\Benchmark\BenchmarkRunInterface;
use Chevere\Interfaces\Message\MessageInterface;
namespace Chevere\Benchmark;

use Chevere\Benchmark\Interfaces\BenchmarkInterface;
use Chevere\Benchmark\Interfaces\BenchmarkRunInterface;
use Chevere\HrTime\HrTime;
use Chevere\Message\Interfaces\MessageInterface;
use Chevere\Message\Message;
use Chevere\Throwable\Errors\ArgumentCountError;
use Chevere\Throwable\Errors\TypeError;
use Chevere\Throwable\Exceptions\InvalidArgumentException;
use DateTime;
use Ds\Map;
use TypeError;

/**
* @codeCoverageIgnore
Expand Down Expand Up @@ -71,8 +69,8 @@ final class BenchmarkRun implements BenchmarkRunInterface
private string $printable = '';

/**
* @throws ArgumentCountException if the argument count doesn't match the callable parameters
* @throws TypeException if the argument types doesn't match
* @throws ArgumentCountError if the argument count doesn't match the callable parameters
* @throws TypeError if the argument types doesn't match
*/
public function __construct(
private BenchmarkInterface $benchmark
Expand Down Expand Up @@ -208,13 +206,13 @@ private function runCallableAt(int $pos): void

try {
$callable(...$this->benchmark->arguments());
} catch (ArgumentCountError $e) {
throw new ArgumentCountException(
} catch (\ArgumentCountError $e) {
throw new ArgumentCountError(
previous: $e,
message: $this->getErrorMessage($name),
);
} catch (TypeError $e) {
throw new TypeException(
} catch (\TypeError $e) {
throw new TypeError(
previous: $e,
message: $this->getErrorMessage($name),
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

declare(strict_types=1);

namespace Chevere\Interfaces\Benchmark;
namespace Chevere\Benchmark\Interfaces;

use Ds\Set;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

declare(strict_types=1);

namespace Chevere\Interfaces\Benchmark;
namespace Chevere\Benchmark\Interfaces;

use Stringable;

Expand Down
30 changes: 15 additions & 15 deletions src/Chevere/Components/Cache/Cache.php → src/Cache/Cache.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,21 +11,21 @@

declare(strict_types=1);

namespace Chevere\Components\Cache;

use Chevere\Components\Filesystem\File;
use Chevere\Components\Filesystem\FilePhp;
use Chevere\Components\Filesystem\FilePhpReturn;
use Chevere\Components\Message\Message;
use Chevere\Exceptions\Core\OutOfBoundsException;
use Chevere\Exceptions\Core\RuntimeException;
use Chevere\Exceptions\Filesystem\DirUnableToCreateException;
use Chevere\Interfaces\Cache\CacheInterface;
use Chevere\Interfaces\Cache\CacheItemInterface;
use Chevere\Interfaces\Cache\CacheKeyInterface;
use Chevere\Interfaces\Filesystem\DirInterface;
use Chevere\Interfaces\Filesystem\PathInterface;
use Chevere\Interfaces\VarSupport\VarStorableInterface;
namespace Chevere\Cache;

use Chevere\Cache\Interfaces\CacheInterface;
use Chevere\Cache\Interfaces\CacheItemInterface;
use Chevere\Cache\Interfaces\CacheKeyInterface;
use Chevere\Filesystem\Exceptions\DirUnableToCreateException;
use Chevere\Filesystem\File;
use Chevere\Filesystem\FilePhp;
use Chevere\Filesystem\FilePhpReturn;
use Chevere\Filesystem\Interfaces\DirInterface;
use Chevere\Filesystem\Interfaces\PathInterface;
use Chevere\Message\Message;
use Chevere\Throwable\Exceptions\OutOfBoundsException;
use Chevere\Throwable\Exceptions\RuntimeException;
use Chevere\VarSupport\Interfaces\VarStorableInterface;
use Throwable;

final class Cache implements CacheInterface
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@

declare(strict_types=1);

namespace Chevere\Components\Cache;
namespace Chevere\Cache;

use Chevere\Exceptions\Core\RuntimeException;
use Chevere\Interfaces\Cache\CacheItemInterface;
use Chevere\Interfaces\Filesystem\FilePhpReturnInterface;
use Chevere\Cache\Interfaces\CacheItemInterface;
use Chevere\Filesystem\Interfaces\FilePhpReturnInterface;
use Chevere\Throwable\Exceptions\RuntimeException;
use Throwable;

final class CacheItem implements CacheItemInterface
Expand Down

0 comments on commit 68ec80b

Please sign in to comment.