railpage/railpagecore

View on GitHub
lib/Locations/Correction.php

Summary

Maintainability
C
1 day
Test Coverage

The method close has a boolean flag argument $action, which is a certain sign of a Single Responsibility Principle violation.
Open

        private function close($action = false, User $Staff, $comments = NULL) {
Severity: Minor
Found in lib/Locations/Correction.php by phpmd

BooleanArgumentFlag

Since: 1.4.0

A boolean flag argument is a reliable indicator for a violation of the Single Responsibility Principle (SRP). You can fix this problem by extracting the logic in the boolean flag into its own class or method.

Example

class Foo {
    public function bar($flag = true) {
    }
}

Source https://phpmd.org/rules/cleancode.html#booleanargumentflag

The method __construct has a boolean flag argument $correction_id, which is a certain sign of a Single Responsibility Principle violation.
Open

        public function __construct($correction_id = false) {
Severity: Minor
Found in lib/Locations/Correction.php by phpmd

BooleanArgumentFlag

Since: 1.4.0

A boolean flag argument is a reliable indicator for a violation of the Single Responsibility Principle (SRP). You can fix this problem by extracting the logic in the boolean flag into its own class or method.

Example

class Foo {
    public function bar($flag = true) {
    }
}

Source https://phpmd.org/rules/cleancode.html#booleanargumentflag

The method commit uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
Open

            } else {
                $this->db->insert("location_corrections", $data); 
                $this->id = filter_var($this->db->lastInsertId(), FILTER_VALIDATE_INT); 
            }
Severity: Minor
Found in lib/Locations/Correction.php by phpmd

ElseExpression

Since: 1.4.0

An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.

Example

class Foo
{
    public function bar($flag)
    {
        if ($flag) {
            // one branch
        } else {
            // another branch
        }
    }
}

Source https://phpmd.org/rules/cleancode.html#elseexpression

Avoid assigning values to variables in if clauses and the like (line '136', column '18').
Open

        private function populate() {
            
            $query = "SELECT * FROM location_corrections WHERE id = ?";
            
            if (!$row = $this->db->fetchRow($query, $this->id)) {
Severity: Minor
Found in lib/Locations/Correction.php by phpmd

IfStatementAssignment

Since: 2.7.0

Assignments in if clauses and the like are considered a code smell. Assignments in PHP return the right operand as their result. In many cases, this is an expected behavior, but can lead to many difficult to spot bugs, especially when the right operand could result in zero, null or an empty string and the like.

Example

class Foo
{
    public function bar($flag)
    {
        if ($foo = 'bar') { // possible typo
            // ...
        }
        if ($baz = 0) { // always false
            // ...
        }
    }
}

Source http://phpmd.org/rules/cleancode.html#ifstatementassignment

Avoid assigning values to variables in if clauses and the like (line '105', column '17').
Open

        public function __construct($correction_id = false) {
            
            parent::__construct(); 
            
            if ($this->id = filter_var($correction_id, FILTER_VALIDATE_INT)) {
Severity: Minor
Found in lib/Locations/Correction.php by phpmd

IfStatementAssignment

Since: 2.7.0

Assignments in if clauses and the like are considered a code smell. Assignments in PHP return the right operand as their result. In many cases, this is an expected behavior, but can lead to many difficult to spot bugs, especially when the right operand could result in zero, null or an empty string and the like.

Example

class Foo
{
    public function bar($flag)
    {
        if ($foo = 'bar') { // possible typo
            // ...
        }
        if ($baz = 0) { // always false
            // ...
        }
    }
}

Source http://phpmd.org/rules/cleancode.html#ifstatementassignment

Similar blocks of code found in 2 locations. Consider refactoring.
Open

            $Message->body = "Your suggested correction for [url=" . $this->Location->url->url . "]" . strval($this->Location) . "[/url] in [url=" . $this->Location->Region->url->url . "]" . strval($this->Location->Region) . "[/url] was " . $verb . " by " . $Staff->username . ".";
Severity: Major
Found in lib/Locations/Correction.php and 1 other location - About 1 hr to fix
lib/Locos/Correction.php on lines 346..346

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 49.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

        public function reject(User $Staff, $comments = NULL) {
            
            $this->close("reject", $Staff, $comments);
            
            return $this;
Severity: Major
Found in lib/Locations/Correction.php and 1 other location - About 1 hr to fix
lib/Locations/Correction.php on lines 246..252

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 38.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

        public function resolve(User $Staff, $comments = NULL) {
            
            $this->close("resolve", $Staff, $comments);
            
            return $this;
Severity: Major
Found in lib/Locations/Correction.php and 1 other location - About 1 hr to fix
lib/Locations/Correction.php on lines 230..236

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 38.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 7 locations. Consider refactoring.
Open

            if (!filter_var($this->status, FILTER_VALIDATE_INT)) {
                $this->status = self::STATUS_NEW;
            }
Severity: Major
Found in lib/Locations/Correction.php and 6 other locations - About 1 hr to fix
lib/Events/EventDate.php on lines 219..221
lib/Forums/Forum.php on lines 286..288
lib/Ideas/Idea.php on lines 264..266
lib/Notifications/Notification.php on lines 179..181
lib/Notifications/Notification.php on lines 183..185
lib/Users/Group.php on lines 384..386

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 34.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 4 locations. Consider refactoring.
Open

            if ($this->DateClosed instanceof DateTime) {
                $data['date_closed'] = $this->DateClosed->format("Y-m-d H:i:s");
            }
Severity: Major
Found in lib/Locations/Correction.php and 3 other locations - About 1 hr to fix
lib/Events/EventDate.php on lines 253..255
lib/Events/EventDate.php on lines 257..259
lib/Users/User.php on lines 1264..1266

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 31.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

            if (!empty($this->comments)) {
                $Message->body .= "\n\n[quote=Your suggestion]" . $this->comments . "[/quote]";
            }
Severity: Minor
Found in lib/Locations/Correction.php and 1 other location - About 1 hr to fix
lib/Locos/Correction.php on lines 351..353

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 30.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 14 locations. Consider refactoring.
Open

            if (!$this->DateAdded instanceof DateTime) {
                $this->DateAdded = new DateTime;
            }
Severity: Major
Found in lib/Locations/Correction.php and 13 other locations - About 50 mins to fix
lib/Content/Page.php on lines 172..174
lib/Downloads/Download.php on lines 285..287
lib/Gallery/Image.php on lines 177..179
lib/Gallery/Image.php on lines 326..328
lib/Glossary/Entry.php on lines 266..268
lib/Ideas/Idea.php on lines 252..254
lib/Images/Collection.php on lines 192..194
lib/Locos/Correction.php on lines 183..185
lib/News/Article.php on lines 778..780
lib/Notifications/Notification.php on lines 187..189
lib/Railcams/Camera.php on lines 363..365
lib/Railcams/Footage.php on lines 143..145
lib/Warnings/Warning.php on lines 227..229

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 27.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

            if (!is_null($comments)) {
                $Message->body .= "\n\n" . $comments;
            }
Severity: Minor
Found in lib/Locations/Correction.php and 1 other location - About 50 mins to fix
lib/Locos/Correction.php on lines 355..357

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 27.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 25 locations. Consider refactoring.
Open

        public function setLocation(Location $Location) {
            
            $this->Location = $Location;
            
            return $this;
Severity: Major
Found in lib/Locations/Correction.php and 24 other locations - About 40 mins to fix
lib/Feedback/Feedback.php on lines 52..56
lib/Gallery/Album.php on lines 279..285
lib/Gallery/Album.php on lines 317..323
lib/Gallery/Image.php on lines 278..284
lib/Gallery/Image.php on lines 460..466
lib/Glossary/Entry.php on lines 302..306
lib/News/Article.php on lines 941..945
lib/Prerender/Prerender.php on lines 89..94
lib/Railcams/Footage.php on lines 89..95
lib/Railcams/Photo.php on lines 143..147
lib/Railcams/Storage.php on lines 95..101
lib/Railcams/Storage.php on lines 110..116
lib/SiteMessages/SiteMessage.php on lines 206..210
lib/Timetables/Timetables.php on lines 52..56
lib/Timetables/Timetables.php on lines 64..68
lib/Timetables/Timetables.php on lines 76..80
lib/Users/SockpuppetManager.php on lines 61..67
lib/Warnings/Warning.php on lines 249..255
lib/Warnings/Warning.php on lines 267..273
lib/AppCore.php on lines 401..407
lib/AppCore.php on lines 416..422
lib/AppCore.php on lines 431..437
lib/AppCore.php on lines 463..469
lib/AppCore.php on lines 478..484

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 23.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 3 locations. Consider refactoring.
Open

            if ($this->id = filter_var($correction_id, FILTER_VALIDATE_INT)) {
                $this->populate(); 
            }
Severity: Minor
Found in lib/Locations/Correction.php and 2 other locations - About 30 mins to fix
lib/Images/Image.php on lines 259..261
lib/Jobs/Job.php on lines 151..154

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 21.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Identical blocks of code found in 2 locations. Consider refactoring.
Open

            if (!$row = $this->db->fetchRow($query, $this->id)) {
                return;
            }
Severity: Minor
Found in lib/Locations/Correction.php and 1 other location - About 30 mins to fix
lib/Railcams/Camera.php on lines 236..238

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 21.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 9 locations. Consider refactoring.
Open

            $this->setAuthor(UserFactory::CreateUser($row['user_id'])); 
Severity: Major
Found in lib/Locations/Correction.php and 8 other locations - About 30 mins to fix
lib/Events/Event.php on lines 215..215
lib/Events/EventDate.php on lines 163..163
lib/Glossary/Entry.php on lines 170..170
lib/Ideas/Idea.php on lines 172..172
lib/Images/Collection.php on lines 137..137
lib/Images/Competition.php on lines 203..203
lib/PrivateMessages/Message.php on lines 289..289
lib/PrivateMessages/Message.php on lines 290..290

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 20.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

The parameter $Staff is not named in camelCase.
Open

        public function reject(User $Staff, $comments = NULL) {
            
            $this->close("reject", $Staff, $comments);
            
            return $this;
Severity: Minor
Found in lib/Locations/Correction.php by phpmd

CamelCaseParameterName

Since: 0.2

It is considered best practice to use the camelCase notation to name parameters.

Example

class ClassName {
    public function doSomething($user_name) {
    }
}

Source

The parameter $Staff is not named in camelCase.
Open

        private function close($action = false, User $Staff, $comments = NULL) {
            
            $this->status = $action == "reject" ? self::STATUS_REJECTED : self::STATUS_CLOSED;
            $this->DateClosed = new DateTime;
            $this->commit(); 
Severity: Minor
Found in lib/Locations/Correction.php by phpmd

CamelCaseParameterName

Since: 0.2

It is considered best practice to use the camelCase notation to name parameters.

Example

class ClassName {
    public function doSomething($user_name) {
    }
}

Source

The parameter $correction_id is not named in camelCase.
Open

        public function __construct($correction_id = false) {
            
            parent::__construct(); 
            
            if ($this->id = filter_var($correction_id, FILTER_VALIDATE_INT)) {
Severity: Minor
Found in lib/Locations/Correction.php by phpmd

CamelCaseParameterName

Since: 0.2

It is considered best practice to use the camelCase notation to name parameters.

Example

class ClassName {
    public function doSomething($user_name) {
    }
}

Source

The parameter $Location is not named in camelCase.
Open

        public function setLocation(Location $Location) {
            
            $this->Location = $Location;
            
            return $this;
Severity: Minor
Found in lib/Locations/Correction.php by phpmd

CamelCaseParameterName

Since: 0.2

It is considered best practice to use the camelCase notation to name parameters.

Example

class ClassName {
    public function doSomething($user_name) {
    }
}

Source

The parameter $Staff is not named in camelCase.
Open

        public function resolve(User $Staff, $comments = NULL) {
            
            $this->close("resolve", $Staff, $comments);
            
            return $this;
Severity: Minor
Found in lib/Locations/Correction.php by phpmd

CamelCaseParameterName

Since: 0.2

It is considered best practice to use the camelCase notation to name parameters.

Example

class ClassName {
    public function doSomething($user_name) {
    }
}

Source

Function closing brace must go on the next line following the body; found 1 blank lines before brace
Open

        }
Severity: Minor
Found in lib/Locations/Correction.php by phpcodesniffer

Function closing brace must go on the next line following the body; found 1 blank lines before brace
Open

        }
Severity: Minor
Found in lib/Locations/Correction.php by phpcodesniffer

Function closing brace must go on the next line following the body; found 1 blank lines before brace
Open

        }
Severity: Minor
Found in lib/Locations/Correction.php by phpcodesniffer

Function closing brace must go on the next line following the body; found 1 blank lines before brace
Open

        }
Severity: Minor
Found in lib/Locations/Correction.php by phpcodesniffer

Function closing brace must go on the next line following the body; found 1 blank lines before brace
Open

        }
Severity: Minor
Found in lib/Locations/Correction.php by phpcodesniffer

Function closing brace must go on the next line following the body; found 1 blank lines before brace
Open

        }
Severity: Minor
Found in lib/Locations/Correction.php by phpcodesniffer

Function closing brace must go on the next line following the body; found 1 blank lines before brace
Open

        }
Severity: Minor
Found in lib/Locations/Correction.php by phpcodesniffer

Function closing brace must go on the next line following the body; found 1 blank lines before brace
Open

        }
Severity: Minor
Found in lib/Locations/Correction.php by phpcodesniffer

Arguments with default values must be at the end of the argument list
Open

        private function close($action = false, User $Staff, $comments = NULL) {
Severity: Minor
Found in lib/Locations/Correction.php by phpcodesniffer

Line indented incorrectly; expected 8 spaces, found 12
Open

            if (!$row = $this->db->fetchRow($query, $this->id)) {
Severity: Minor
Found in lib/Locations/Correction.php by phpcodesniffer

Line indented incorrectly; expected 8 spaces, found 12
Open

            }
Severity: Minor
Found in lib/Locations/Correction.php by phpcodesniffer

Line indented incorrectly; expected 8 spaces, found 12
Open

            if (!filter_var($this->status, FILTER_VALIDATE_INT)) {
Severity: Minor
Found in lib/Locations/Correction.php by phpcodesniffer

Line indented incorrectly; expected 4 spaces, found 8
Open

        public $comments;
Severity: Minor
Found in lib/Locations/Correction.php by phpcodesniffer

Line indented incorrectly; expected 4 spaces, found 8
Open

        public $status;
Severity: Minor
Found in lib/Locations/Correction.php by phpcodesniffer

Line indented incorrectly; expected 4 spaces, found 8
Open

        public $DateClosed;
Severity: Minor
Found in lib/Locations/Correction.php by phpcodesniffer

Line indented incorrectly; expected 4 spaces, found 8
Open

        private function populate() {
Severity: Minor
Found in lib/Locations/Correction.php by phpcodesniffer

Line indented incorrectly; expected 4 spaces, found 8
Open

        private function validate() {
Severity: Minor
Found in lib/Locations/Correction.php by phpcodesniffer

Line indented incorrectly; expected 8 spaces, found 12
Open

            if (empty($this->comments)) {
Severity: Minor
Found in lib/Locations/Correction.php by phpcodesniffer

Line indented incorrectly; expected 8 spaces, found 12
Open

            }
Severity: Minor
Found in lib/Locations/Correction.php by phpcodesniffer

Line indented incorrectly; expected 4 spaces, found 8
Open

        }
Severity: Minor
Found in lib/Locations/Correction.php by phpcodesniffer

Line indented incorrectly; expected 8 spaces, found 12
Open

            if (!is_null($row['date_closed'])) {
Severity: Minor
Found in lib/Locations/Correction.php by phpcodesniffer

Line indented incorrectly; expected 8 spaces, found 12
Open

            if (!$this->DateAdded instanceof DateTime) {
Severity: Minor
Found in lib/Locations/Correction.php by phpcodesniffer

Line indented incorrectly; expected 4 spaces, found 8
Open

        }
Severity: Minor
Found in lib/Locations/Correction.php by phpcodesniffer

Line indented incorrectly; expected 4 spaces, found 8
Open

        }
Severity: Minor
Found in lib/Locations/Correction.php by phpcodesniffer

Line indented incorrectly; expected 4 spaces, found 8
Open

        private function close($action = false, User $Staff, $comments = NULL) {
Severity: Minor
Found in lib/Locations/Correction.php by phpcodesniffer

Line indented incorrectly; expected 8 spaces, found 12
Open

            }
Severity: Minor
Found in lib/Locations/Correction.php by phpcodesniffer

Line indented incorrectly; expected 8 spaces, found 12
Open

            if (!is_null($comments)) {
Severity: Minor
Found in lib/Locations/Correction.php by phpcodesniffer

Line indented incorrectly; expected 4 spaces, found 8
Open

        public $DateAdded;
Severity: Minor
Found in lib/Locations/Correction.php by phpcodesniffer

Line indented incorrectly; expected 8 spaces, found 12
Open

            }
Severity: Minor
Found in lib/Locations/Correction.php by phpcodesniffer

Line indented incorrectly; expected 0 spaces, found 4
Open

    class Correction extends AppCore {
Severity: Minor
Found in lib/Locations/Correction.php by phpcodesniffer

Line indented incorrectly; expected 4 spaces, found 8
Open

        public function setLocation(Location $Location) {
Severity: Minor
Found in lib/Locations/Correction.php by phpcodesniffer

Line indented incorrectly; expected 4 spaces, found 8
Open

        }
Severity: Minor
Found in lib/Locations/Correction.php by phpcodesniffer

Line indented incorrectly; expected 4 spaces, found 8
Open

        }
Severity: Minor
Found in lib/Locations/Correction.php by phpcodesniffer

Line indented incorrectly; expected 4 spaces, found 8
Open

        public $Location;
Severity: Minor
Found in lib/Locations/Correction.php by phpcodesniffer

Line indented incorrectly; expected 8 spaces, found 12
Open

            if ($this->id = filter_var($correction_id, FILTER_VALIDATE_INT)) {
Severity: Minor
Found in lib/Locations/Correction.php by phpcodesniffer

Line indented incorrectly; expected 0 spaces, found 4
Open

    }
Severity: Minor
Found in lib/Locations/Correction.php by phpcodesniffer

Line indented incorrectly; expected 4 spaces, found 8
Open

        public function __construct($correction_id = false) {
Severity: Minor
Found in lib/Locations/Correction.php by phpcodesniffer

Line indented incorrectly; expected 4 spaces, found 8
Open

        }
Severity: Minor
Found in lib/Locations/Correction.php by phpcodesniffer

Line indented incorrectly; expected 8 spaces, found 12
Open

            }
Severity: Minor
Found in lib/Locations/Correction.php by phpcodesniffer

Line indented incorrectly; expected 8 spaces, found 12
Open

            if ($this->DateClosed instanceof DateTime) {
Severity: Minor
Found in lib/Locations/Correction.php by phpcodesniffer

Line indented incorrectly; expected 8 spaces, found 12
Open

            if (!empty($this->comments)) {
Severity: Minor
Found in lib/Locations/Correction.php by phpcodesniffer

Line indented incorrectly; expected 4 spaces, found 8
Open

        public $id;
Severity: Minor
Found in lib/Locations/Correction.php by phpcodesniffer

Line indented incorrectly; expected 8 spaces, found 12
Open

            }
Severity: Minor
Found in lib/Locations/Correction.php by phpcodesniffer

Line indented incorrectly; expected 4 spaces, found 8
Open

        public function resolve(User $Staff, $comments = NULL) {
Severity: Minor
Found in lib/Locations/Correction.php by phpcodesniffer

Line indented incorrectly; expected 8 spaces, found 12
Open

            if (filter_var($this->id, FILTER_VALIDATE_INT)) {
Severity: Minor
Found in lib/Locations/Correction.php by phpcodesniffer

Line indented incorrectly; expected 4 spaces, found 8
Open

        }
Severity: Minor
Found in lib/Locations/Correction.php by phpcodesniffer

Line indented incorrectly; expected 4 spaces, found 8
Open

        }
Severity: Minor
Found in lib/Locations/Correction.php by phpcodesniffer

Line indented incorrectly; expected 4 spaces, found 8
Open

        public function commit() {
Severity: Minor
Found in lib/Locations/Correction.php by phpcodesniffer

Line indented incorrectly; expected 8 spaces, found 12
Open

            }
Severity: Minor
Found in lib/Locations/Correction.php by phpcodesniffer

Line indented incorrectly; expected 8 spaces, found 12
Open

            }
Severity: Minor
Found in lib/Locations/Correction.php by phpcodesniffer

Line indented incorrectly; expected 8 spaces, found 12
Open

            if (!$this->Location instanceof Location) {
Severity: Minor
Found in lib/Locations/Correction.php by phpcodesniffer

Line indented incorrectly; expected 8 spaces, found 12
Open

            }
Severity: Minor
Found in lib/Locations/Correction.php by phpcodesniffer

Line indented incorrectly; expected 8 spaces, found 12
Open

            }
Severity: Minor
Found in lib/Locations/Correction.php by phpcodesniffer

Line indented incorrectly; expected 8 spaces, found 12
Open

            } else {
Severity: Minor
Found in lib/Locations/Correction.php by phpcodesniffer

Line indented incorrectly; expected 8 spaces, found 12
Open

            }
Severity: Minor
Found in lib/Locations/Correction.php by phpcodesniffer

Line indented incorrectly; expected 8 spaces, found 12
Open

            if (!$this->Author instanceof User) {
Severity: Minor
Found in lib/Locations/Correction.php by phpcodesniffer

Line indented incorrectly; expected 4 spaces, found 8
Open

        public function reject(User $Staff, $comments = NULL) {
Severity: Minor
Found in lib/Locations/Correction.php by phpcodesniffer

Line indented incorrectly; expected 8 spaces, found 12
Open

            }
Severity: Minor
Found in lib/Locations/Correction.php by phpcodesniffer

There are no issues that match your filters.

Category
Status