for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/*
* Copyright (c) Arnaud Ligny <[email protected]>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Cecil\Collection\Taxonomy;
use Cecil\Collection\Collection as CecilCollection;
use Cecil\Collection\ItemInterface;
/**
* Class Term.
class Term extends CecilCollection implements ItemInterface
{
* Term's name.
* @var string
protected $name;
* Set term's name.
* @param string $value
* @return self
public function setName(string $value): self
$this->name = $value;
return $this;
}
* get term's name.
* @return string|null
public function getName(): ?string
return $this->name;
* Sort items by date.
\self
This check compares the return type specified in the @return annotation of a function or method doc comment with the types returned by the function and raises an issue if they mismatch.
@return
public function sortByDate(): self
return $this->usort(function ($a, $b) {
if (!isset($a['date'])) {
return -1;
if (!isset($b['date'])) {
return 1;
if ($a['date'] == $b['date']) {
return 0;
return ($a['date'] > $b['date']) ? -1 : 1;
});
This check compares the return type specified in the
@returnannotation of a function or method doc comment with the types returned by the function and raises an issue if they mismatch.