execute accesses the super-global variable $_REQUEST. Open
public function execute() {
// Load the existing internship using its ID
$internship = InternshipFactory::getInternshipById($_REQUEST['internshipId']);
// Load the emergency contacts from the old internship
- 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() {
// Load the existing internship using its ID
$internship = InternshipFactory::getInternshipById($_REQUEST['internshipId']);
// Load the emergency contacts from the old internship
- 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 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function execute() {
// Load the existing internship using its ID
$internship = InternshipFactory::getInternshipById($_REQUEST['internshipId']);
// Load the emergency contacts from the old internship
- Create a ticketCreate a ticket
Missing class import via use statement (line '69', column '23'). Open
throw new \InvalidArgumentException('Requested term does not exist: ' . $destTermCode);
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
MissingImport
Since: 2.7.0
Importing all external classes in a file through use statements makes them clearly visible.
Example
function make() {
return new \stdClass();
}
Source http://phpmd.org/rules/cleancode.html#MissingImport
Avoid using static access to class '\Intern\SupervisorFactory' in method 'execute'. Open
$supervisor = SupervisorFactory::getSupervisorById($internship->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 '\PHPWS_Core' in method 'execute'. Open
return \PHPWS_Core::reroute('index.php?module=intern&action=ShowInternship&internship_id=' . $copyId);
- 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\DatabaseStorage' in method 'execute'. Open
DatabaseStorage::save($newSupervisor);
- 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\DatabaseStorage' in method 'execute'. Open
DatabaseStorage::save($newContact);
- 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::SUCCESS, 'Continued internship for ' . $internship->getFullName() . ' to ' . $newTerm->getDescription() . '.');
- 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 '\Intern\TermFactory' in method 'execute'. Open
$newTerm = TermFactory::getTermByTermCode($destTermCode);
- 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
$internship = InternshipFactory::getInternshipById($_REQUEST['internshipId']);
- 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\EmergencyContactFactory' in method 'execute'. Open
$contacts = EmergencyContactFactory::getContactsForInternship($internship);
- 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\WorkflowStateFactory' in method 'execute'. Open
$state = WorkflowStateFactory::getState('CreationState');
- 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
Suspicious type \Intern\new
of a variable or expression used to build a string. (Expected type to be able to cast to a string) Open
return \PHPWS_Core::reroute('index.php?module=intern&action=ShowInternship&internship_id=' . $copyId);
- Create a ticketCreate a ticket
- Exclude checks
Call to method reroute
from undeclared class \PHPWS_Core
Open
return \PHPWS_Core::reroute('index.php?module=intern&action=ShowInternship&internship_id=' . $copyId);
- Create a ticketCreate a ticket
- Exclude checks
Call with 1 arg(s) to \Intern\EmergencyContact::getPhone()
which only takes 0 arg(s) defined at /code/class/EmergencyContact.php:106
Open
$phone = $contact->getPhone($copyId);
- Create a ticketCreate a ticket
- Exclude checks
Call to method simple
from undeclared class \NQ
Open
\NQ::simple('intern', \Intern\UI\NotifyUI::SUCCESS, 'Continued internship for ' . $internship->getFullName() . ' to ' . $newTerm->getDescription() . '.');
- Create a ticketCreate a ticket
- Exclude checks
Call with 1 arg(s) to \Intern\EmergencyContact::getName()
which only takes 0 arg(s) defined at /code/class/EmergencyContact.php:96
Open
$name = $contact->getName($copyId);
- Create a ticketCreate a ticket
- Exclude checks
Call with 1 arg(s) to \Intern\EmergencyContact::getRelation()
which only takes 0 arg(s) defined at /code/class/EmergencyContact.php:101
Open
$relation = $contact->getRelation($copyId);
- Create a ticketCreate a ticket
- Exclude checks
Call with 1 arg(s) to \Intern\EmergencyContact::getEmail()
which only takes 0 arg(s) defined at /code/class/EmergencyContact.php:111
Open
$email = $contact->getEmail($copyId);
- Create a ticketCreate a ticket
- Exclude checks
Argument 1 (id)
is string|string[]
but \Intern\InternshipFactory::getInternshipById()
takes int
defined at /code/class/InternshipFactory.php:37
Open
$internship = InternshipFactory::getInternshipById($_REQUEST['internshipId']);
- 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