execute accesses the super-global variable $_REQUEST. Open
public function execute()
{
// Make sure an 'internship_id' key is set on the request
if(!isset($_REQUEST['internship_id'])) {
\NQ::simple('intern', \Intern\UI\NotifyUI::ERROR, 'No internship ID was given.');
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
Superglobals
Since: 0.2
Accessing a super-global variable directly is considered a bad practice. These variables should be encapsulated in objects that are provided by a framework, for instance.
Example
class Foo {
public function bar() {
$name = $_POST['foo'];
}
}
Source
execute accesses the super-global variable $_REQUEST. Open
public function execute()
{
// Make sure an 'internship_id' key is set on the request
if(!isset($_REQUEST['internship_id'])) {
\NQ::simple('intern', \Intern\UI\NotifyUI::ERROR, 'No internship ID was given.');
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
Superglobals
Since: 0.2
Accessing a super-global variable directly is considered a bad practice. These variables should be encapsulated in objects that are provided by a framework, for instance.
Example
class Foo {
public function bar() {
$name = $_POST['foo'];
}
}
Source
Method execute
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function execute()
{
// Make sure an 'internship_id' key is set on the request
if(!isset($_REQUEST['internship_id'])) {
\NQ::simple('intern', \Intern\UI\NotifyUI::ERROR, 'No internship ID was given.');
- Create a ticketCreate a ticket
Avoid using static access to class '\NQ' in method 'execute'. Open
\NQ::simple('intern', \Intern\UI\NotifyUI::ERROR, 'No internship ID was given.');
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
StaticAccess
Since: 1.4.0
Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.
Example
class Foo
{
public function bar()
{
Bar::baz();
}
}
Source https://phpmd.org/rules/cleancode.html#staticaccess
Avoid using static access to class '\Intern\SupervisorFactory' in method 'execute'. Open
$supervisor = SupervisorFactory::getSupervisorById($intern->getSupervisorId());
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
StaticAccess
Since: 1.4.0
Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.
Example
class Foo
{
public function bar()
{
Bar::baz();
}
}
Source https://phpmd.org/rules/cleancode.html#staticaccess
Avoid using static access to class '\Intern\TermFactory' in method 'execute'. Open
$term = TermFactory::getTermByTermCode($intern->getTerm());
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
StaticAccess
Since: 1.4.0
Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.
Example
class Foo
{
public function bar()
{
Bar::baz();
}
}
Source https://phpmd.org/rules/cleancode.html#staticaccess
Avoid using static access to class '\NQ' in method 'execute'. Open
\NQ::close();
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
StaticAccess
Since: 1.4.0
Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.
Example
class Foo
{
public function bar()
{
Bar::baz();
}
}
Source https://phpmd.org/rules/cleancode.html#staticaccess
Avoid using static access to class '\PHPWS_Core' in method 'execute'. Open
\PHPWS_Core::reroute('index.php');
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
StaticAccess
Since: 1.4.0
Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.
Example
class Foo
{
public function bar()
{
Bar::baz();
}
}
Source https://phpmd.org/rules/cleancode.html#staticaccess
Avoid using static access to class '\Intern\SubHostFactory' in method 'execute'. Open
$host = SubHostFactory::getSubById($intern->getSubId());
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
StaticAccess
Since: 1.4.0
Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.
Example
class Foo
{
public function bar()
{
Bar::baz();
}
}
Source https://phpmd.org/rules/cleancode.html#staticaccess
Avoid using static access to class '\Intern\InternshipFactory' in method 'execute'. Open
$intern = InternshipFactory::getInternshipById($_REQUEST['internship_id']);
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
StaticAccess
Since: 1.4.0
Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.
Example
class Foo
{
public function bar()
{
Bar::baz();
}
}
Source https://phpmd.org/rules/cleancode.html#staticaccess
Avoid using static access to class '\NQ' in method 'execute'. Open
\NQ::simple('intern', \Intern\UI\NotifyUI::WARNING, "We couldn't find a student with an ID of {$studentId} in Banner. This probably means this person is not an active student.");
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
StaticAccess
Since: 1.4.0
Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.
Example
class Foo
{
public function bar()
{
Bar::baz();
}
}
Source https://phpmd.org/rules/cleancode.html#staticaccess
Avoid using static access to class '\NQ' in method 'execute'. Open
\NQ::simple('intern', \Intern\UI\NotifyUI::ERROR, 'Could not locate an internship with the given ID.');
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
StaticAccess
Since: 1.4.0
Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.
Example
class Foo
{
public function bar()
{
Bar::baz();
}
}
Source https://phpmd.org/rules/cleancode.html#staticaccess
Avoid using static access to class '\NQ' in method 'execute'. Open
\NQ::simple('intern', \Intern\UI\NotifyUI::ERROR, 'Could not locate an internship with the given ID.');
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
StaticAccess
Since: 1.4.0
Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.
Example
class Foo
{
public function bar()
{
Bar::baz();
}
}
Source https://phpmd.org/rules/cleancode.html#staticaccess
Call to method simple
from undeclared class \NQ
Open
\NQ::simple('intern', \Intern\UI\NotifyUI::ERROR, 'Could not locate an internship with the given ID.');
- Create a ticketCreate a ticket
- Exclude checks
Call to method close
from undeclared class \NQ
Open
\NQ::close();
- Create a ticketCreate a ticket
- Exclude checks
Call to method simple
from undeclared class \NQ
Open
\NQ::simple('intern', \Intern\UI\NotifyUI::ERROR, 'No internship ID was given.');
- Create a ticketCreate a ticket
- Exclude checks
Call to method simple
from undeclared class \NQ
Open
\NQ::simple('intern', \Intern\UI\NotifyUI::ERROR, 'Could not locate an internship with the given ID.');
- Create a ticketCreate a ticket
- Exclude checks
Call to method simple
from undeclared class \NQ
Open
\NQ::simple('intern', \Intern\UI\NotifyUI::WARNING, "We couldn't find a student with an ID of {$studentId} in Banner. This probably means this person is not an active student.");
- Create a ticketCreate a ticket
- Exclude checks
Argument 1 (termCode)
is int
but \Intern\TermFactory::getTermByTermCode()
takes string
defined at /code/class/TermFactory.php:32
Open
$term = TermFactory::getTermByTermCode($intern->getTerm());
- Create a ticketCreate a ticket
- Exclude checks
Call to method reroute
from undeclared class \PHPWS_Core
Open
\PHPWS_Core::reroute('index.php');
- Create a ticketCreate a ticket
- Exclude checks