for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
declare(strict_types=1);
namespace Version\Extension;
use Version\Exception\InvalidVersion;
abstract class Extension
{
protected const IDENTIFIERS_SEPARATOR = '.';
private $identifiers;
final protected function __construct(array $identifiers)
$this->validate($identifiers);
$this->identifiers = $identifiers;
}
/**
* @throws InvalidVersion
*/
abstract protected function validate(array $identifiers): void;
public static function from(string $identifier, string ...$identifiers)
$identifier
This check looks from parameters that have been defined for a function or method, but which are not used in the method body.
$identifiers
return new static(func_get_args());
public static function fromArray(array $identifiers)
return new static($identifiers);
public static function fromString(string $extension)
return new static(explode(self::IDENTIFIERS_SEPARATOR, trim($extension)));
public function getIdentifiers(): array
return $this->identifiers;
public function toString(): string
return implode(self::IDENTIFIERS_SEPARATOR, $this->identifiers);
This check looks from parameters that have been defined for a function or method, but which are not used in the method body.