for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/*
* This file is part of the Tinyissue package.
*
* (c) Mohamed Alsharaf <[email protected]>
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Tinyissue\Model\Traits\Tag;
use Tinyissue\Model\Tag;
/**
* DataMappingTrait is trait class containing methods to manipulate the data of the Tag model.
* @author Mohamed Alsharaf <[email protected]>
trait DataMappingTrait
{
* Callback to return tag details for JS library tokenfield.
* @param Tag $tag
* @return array
public function tokenFieldCallback(Tag $tag)
return array_combine([
'value',
'label',
'bgcolor',
], $this->toArray($tag));
toArray()
Tinyissue\Model\Traits\Tag\DataMappingTrait
toArrayCallback()
This check marks calls to methods that do not seem to exist on an object.
This is most likely the result of a method being renamed without all references to it being renamed likewise.
}
* Callback to return tag details as array.
public function toArrayCallback(Tag $tag)
return [
'id' => $tag->id,
'name' => $tag->fullname,
'bgcolor' => $tag->bgcolor,
];
This check marks calls to methods that do not seem to exist on an object.
This is most likely the result of a method being renamed without all references to it being renamed likewise.