for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php namespace Comodojo\Extender\Traits;
use \Comodojo\Extender\Task\TaskParameters;
/**
* @package Comodojo Extender
* @author Marco Giovinazzi <[email protected]>
* @license MIT
*
* LICENSE:
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
trait BaseEntityTrait {
* @var integer
* @ORM\Id
* @ORM\Column(type="integer", nullable=false)
* @ORM\GeneratedValue(strategy="AUTO")
protected $id = 0;
* @var string
* @ORM\Column(name="name", type="string", length=256, nullable=false)
protected $name;
* Get queue item's id
* @return integer
public function getId() {
return $this->id;
}
* Set queue item's id
* @param string $id
* @return Schedule
public function setId($id) {
$this->id = $id;
$id
integer
string
This check looks for assignments to scalar types that may be of the wrong type.
To ensure the code behaves as expected, it may be a good idea to add an explicit type cast.
$answer = 42; $correct = false; $correct = (bool) $answer;
return $this;
* Get queue item's name
* @return string
public function getName() {
return $this->name;
* Set queue item's name
* @param string $name
public function setName($name) {
$this->name = $name;
* Returns the properties of this object as an array for ease of use
* @return array
public function toArray() {
return get_object_vars($this);
This check looks for assignments to scalar types that may be of the wrong type.
To ensure the code behaves as expected, it may be a good idea to add an explicit type cast.