for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace ICanBoogie\CLDR\Supplemental\Units;
use ICanBoogie\Accessor\AccessorTrait;
/**
* Representation of a unit.
*
* @property-read string $name
* @uses self::get_name()
* @property-read string $long_name
* @uses self::get_long_name()
* @property-read string $short_name
* @uses self::get_short_name()
* @property-read string $narrow_name
* @uses self::get_narrow_name()
*/
final class Unit
{
* @uses get_name
* @uses get_long_name
* @uses get_short_name
* @uses get_narrow_name
use AccessorTrait;
private function get_name(): string
get_name()
This check looks for private methods that have been defined, but are not used inside the class.
return $this->long_name;
}
private function get_long_name(): string
get_long_name()
return $this->name_for(UnitLength::LONG);
private function get_short_name(): string
get_short_name()
return $this->name_for(UnitLength::SHORT);
private function get_narrow_name(): string
get_narrow_name()
return $this->name_for(UnitLength::NARROW);
public function __construct(
private readonly Units $units,
private readonly string $unit
) {
public function __toString(): string
return $this->unit;
private function name_for(UnitLength $length): string
return $this->units->name_for($this->unit, $length);
This check looks for private methods that have been defined, but are not used inside the class.