-4

I'm getting this error and when I'm looking the ide its says

Unexpected: error silence

This is my code.

I'm just trying to make classmap.

class GetEntityLocation
{

    /**
     * @var  integer
     */
    @protected $Region_ID;
    /**
     * @var integer
     */
    @protected $Match_ID;


    /**
     * GetEntityLocation constructor.
     * @param integer $Region_ID
     * @param integer $Match_ID
     */

    public function __construct($Region_ID, $Match_ID)
    {
        $this->Region_ID = $Region_ID;
        $this->Match_ID = $Match_ID;
    }

    /**
     * @return integer
     */
    public function getRegionID() {
        return $this->Region_ID;
    }

}
Murat Kaya
  • 1,281
  • 3
  • 28
  • 52

1 Answers1

3

Your code is invalid. This is what php has to say about using the @ sign.

PHP supports one error control operator: the at sign (@). When prepended to an expression in PHP, any error messages that might be generated by that expression will be ignored.

This is the example showed in the php doc

/* Intentional file error */
$my_file = @file ('non_existent_file') or
    die ("Failed opening file: error was '$php_errormsg'");

// this works for any expression, not just functions:
$value = @$cache[$key];
// will not issue a notice if the index $key doesn't exist.

So you can use @ sign to suppress errors generated by a function or an expression. But you cannot use it against the visibility of a class property.

Instead of using

@protected $Region_ID;
@protected $Match_ID;

use

protected $Region_ID;
protected $Match_ID;

Always stick to best practices.

Gayan
  • 3,614
  • 1
  • 27
  • 34