Skip to content

Commit

Permalink
Finalize Arcanist Classes
Browse files Browse the repository at this point in the history
Summary:
Mark all applicable Arcanist classes as "final", except PhutilLintEngine, which
needs a little finesse.

@jungejason / @nh, does this break any Facebook stuff?

Test Plan: Linter no longer raises warnings. Ran "testEverythingImplemented" in
Phabricator.

Reviewers: btrahan, jungejason, nh

Reviewed By: btrahan

CC: aran, epriestley

Maniphest Tasks: T795

Differential Revision: https://secure.phabricator.com/D1519
  • Loading branch information
epriestley committed Jan 31, 2012
1 parent f70afcd commit 8fe38f8
Show file tree
Hide file tree
Showing 75 changed files with 123 additions and 116 deletions.
4 changes: 2 additions & 2 deletions src/branch/BranchInfo.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php

/*
* Copyright 2011 Facebook, Inc.
* Copyright 2012 Facebook, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -20,7 +20,7 @@
* Holds information about a single git branch, and provides methods
* for loading and display.
*/
class BranchInfo {
final class BranchInfo {

private $branchName;
private $currentHead = false;
Expand Down
3 changes: 2 additions & 1 deletion src/configuration/ArcanistConfiguration.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php

/*
* Copyright 2011 Facebook, Inc.
* Copyright 2012 Facebook, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -37,6 +37,7 @@
* getCustomArgumentsForCommand().
*
* @group config
* @concrete-extensible
*/
class ArcanistConfiguration {

Expand Down
4 changes: 2 additions & 2 deletions src/difference/__tests__/ArcanistDiffUtilsTestCase.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php

/*
* Copyright 2011 Facebook, Inc.
* Copyright 2012 Facebook, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -21,7 +21,7 @@
*
* @group testcase
*/
class ArcanistDiffUtilsTestCase extends ArcanistPhutilTestCase {
final class ArcanistDiffUtilsTestCase extends ArcanistPhutilTestCase {
public function testLevenshtein() {
$tests = array(
array(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
*
* @group differential
*/
class ArcanistDifferentialCommitMessage {
final class ArcanistDifferentialCommitMessage {

private $rawCorpus;
private $revisionID;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php

/*
* Copyright 2011 Facebook, Inc.
* Copyright 2012 Facebook, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -21,7 +21,7 @@
*
* @group differential
*/
class ArcanistDifferentialCommitMessageParserException extends Exception {
final class ArcanistDifferentialCommitMessageParserException extends Exception {

private $parserErrors;

Expand Down
4 changes: 2 additions & 2 deletions src/differential/revision/ArcanistDifferentialRevisionRef.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php

/*
* Copyright 2011 Facebook, Inc.
* Copyright 2012 Facebook, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -21,7 +21,7 @@
*
* @group differential
*/
class ArcanistDifferentialRevisionRef {
final class ArcanistDifferentialRevisionRef {

protected $id;
protected $name;
Expand Down
4 changes: 2 additions & 2 deletions src/exception/ArcanistChooseInvalidRevisionException.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php

/*
* Copyright 2011 Facebook, Inc.
* Copyright 2012 Facebook, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -21,6 +21,6 @@
*
* @group workflow
*/
class ArcanistChooseInvalidRevisionException extends Exception {
final class ArcanistChooseInvalidRevisionException extends Exception {

}
4 changes: 2 additions & 2 deletions src/exception/ArcanistChooseNoRevisionsException.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php

/*
* Copyright 2011 Facebook, Inc.
* Copyright 2012 Facebook, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -22,6 +22,6 @@
*
* @group workflow
*/
class ArcanistChooseNoRevisionsException extends Exception {
final class ArcanistChooseNoRevisionsException extends Exception {

}
3 changes: 2 additions & 1 deletion src/exception/usage/ArcanistUsageException.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php

/*
* Copyright 2011 Facebook, Inc.
* Copyright 2012 Facebook, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -21,6 +21,7 @@
* than a technical problem.
*
* @group workflow
* @concrete-extensible
*/
class ArcanistUsageException extends Exception {

Expand Down
4 changes: 2 additions & 2 deletions src/exception/usage/noeffect/ArcanistNoEffectException.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php

/*
* Copyright 2011 Facebook, Inc.
* Copyright 2012 Facebook, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -22,5 +22,5 @@
*
* @group workflow
*/
class ArcanistNoEffectException extends ArcanistUsageException {
final class ArcanistNoEffectException extends ArcanistUsageException {
}
4 changes: 2 additions & 2 deletions src/exception/usage/noengine/ArcanistNoEngineException.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php

/*
* Copyright 2011 Facebook, Inc.
* Copyright 2012 Facebook, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -21,5 +21,5 @@
*
* @group workflow
*/
class ArcanistNoEngineException extends ArcanistUsageException {
final class ArcanistNoEngineException extends ArcanistUsageException {
}
4 changes: 2 additions & 2 deletions src/exception/usage/userabort/ArcanistUserAbortException.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php

/*
* Copyright 2011 Facebook, Inc.
* Copyright 2012 Facebook, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -22,7 +22,7 @@
*
* @group workflow
*/
class ArcanistUserAbortException extends ArcanistUsageException {
final class ArcanistUserAbortException extends ArcanistUsageException {
public function __construct() {
parent::__construct('User aborted the workflow.');
}
Expand Down
1 change: 1 addition & 0 deletions src/lint/engine/base/ArcanistLintEngine.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@
* and Workflows} for more information about configuring lint engines.
*
* @group lint
* @stable
*/
abstract class ArcanistLintEngine {

Expand Down
2 changes: 1 addition & 1 deletion src/lint/engine/comprehensive/ComprehensiveLintEngine.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
*
* @group linter
*/
class ComprehensiveLintEngine extends ArcanistLintEngine {
final class ComprehensiveLintEngine extends ArcanistLintEngine {

public function buildLinters() {
$linters = array();
Expand Down
4 changes: 2 additions & 2 deletions src/lint/engine/example/ExampleLintEngine.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php

/*
* Copyright 2011 Facebook, Inc.
* Copyright 2012 Facebook, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -23,7 +23,7 @@
*
* @group linter
*/
class ExampleLintEngine extends ArcanistLintEngine {
final class ExampleLintEngine extends ArcanistLintEngine {

public function buildLinters() {

Expand Down
4 changes: 2 additions & 2 deletions src/lint/engine/liberate/ArcanistLiberateLintEngine.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php

/*
* Copyright 2011 Facebook, Inc.
* Copyright 2012 Facebook, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -21,7 +21,7 @@
*
* @group linter
*/
class ArcanistLiberateLintEngine extends ArcanistLintEngine {
final class ArcanistLiberateLintEngine extends ArcanistLintEngine {

public function buildLinters() {
// We just run the module linter, 'arc liberate' is only interested in
Expand Down
2 changes: 2 additions & 0 deletions src/lint/engine/phutil/PhutilLintEngine.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@
/**
* Lint engine which enforces libphutil rules.
*
* TODO: Deal with PhabricatorLintEngine extending this and then finalize it.
*
* @group linter
*/
class PhutilLintEngine extends ArcanistLintEngine {
Expand Down
4 changes: 2 additions & 2 deletions src/lint/linter/apachelicense/ArcanistApacheLicenseLinter.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php

/*
* Copyright 2011 Facebook, Inc.
* Copyright 2012 Facebook, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -21,7 +21,7 @@
*
* @group linter
*/
class ArcanistApacheLicenseLinter extends ArcanistLicenseLinter {
final class ArcanistApacheLicenseLinter extends ArcanistLicenseLinter {
public function getLinterName() {
return 'APACHELICENSE';
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
*
* @group testcase
*/
class ArcanistApacheLicenseLinterTestCase extends ArcanistLinterTestCase {
final class ArcanistApacheLicenseLinterTestCase extends ArcanistLinterTestCase {

public function testApacheLicenseLint() {
$linter = new ArcanistApacheLicenseLinter();
Expand Down
1 change: 1 addition & 0 deletions src/lint/linter/base/ArcanistLinter.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
* Implements lint rules, like syntax checks for a specific language.
*
* @group linter
* @stable
*/
abstract class ArcanistLinter {

Expand Down
2 changes: 1 addition & 1 deletion src/lint/linter/conduit/ArcanistConduitLinter.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
* This class is intended for customization via instantiation, not via
* subclassing.
*/
class ArcanistConduitLinter extends ArcanistLinter {
final class ArcanistConduitLinter extends ArcanistLinter {
const CONDUIT_METHOD = 'lint.getalllint';

private $conduitURI;
Expand Down
4 changes: 2 additions & 2 deletions src/lint/linter/filename/ArcanistFilenameLinter.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php

/*
* Copyright 2011 Facebook, Inc.
* Copyright 2012 Facebook, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -21,7 +21,7 @@
*
* @group linter
*/
class ArcanistFilenameLinter extends ArcanistLinter {
final class ArcanistFilenameLinter extends ArcanistLinter {

const LINT_BAD_FILENAME = 1;

Expand Down
4 changes: 2 additions & 2 deletions src/lint/linter/generated/ArcanistGeneratedLinter.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php

/*
* Copyright 2011 Facebook, Inc.
* Copyright 2012 Facebook, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -21,7 +21,7 @@
*
* @group linter
*/
class ArcanistGeneratedLinter extends ArcanistLinter {
final class ArcanistGeneratedLinter extends ArcanistLinter {

public function willLintPaths(array $paths) {
return;
Expand Down
4 changes: 2 additions & 2 deletions src/lint/linter/jshint/ArcanistJSHintLinter.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php

/*
* Copyright 2011 Facebook, Inc.
* Copyright 2012 Facebook, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -52,7 +52,7 @@
*
* @group linter
*/
class ArcanistJSHintLinter extends ArcanistLinter {
final class ArcanistJSHintLinter extends ArcanistLinter {

const JSHINT_ERROR = 1;

Expand Down
4 changes: 2 additions & 2 deletions src/lint/linter/nolint/ArcanistNoLintLinter.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php

/*
* Copyright 2011 Facebook, Inc.
* Copyright 2012 Facebook, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -22,7 +22,7 @@
*
* @group linter
*/
class ArcanistNoLintLinter extends ArcanistLinter {
final class ArcanistNoLintLinter extends ArcanistLinter {
public function willLintPaths(array $paths) {
return;
}
Expand Down
2 changes: 1 addition & 1 deletion src/lint/linter/pep8/ArcanistPEP8Linter.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
*
* @group linter
*/
class ArcanistPEP8Linter extends ArcanistLinter {
final class ArcanistPEP8Linter extends ArcanistLinter {

public function willLintPaths(array $paths) {
return;
Expand Down
Loading

0 comments on commit 8fe38f8

Please sign in to comment.