Skip to content
Permalink
Browse files

Code style cleanup.

  • Loading branch information...
corpsee committed Jun 7, 2019
1 parent 57ce48d commit f99a0e2cda57af19ad387494801daec0135e420c
Showing with 1,338 additions and 900 deletions.
  1. +0 −2 .gitignore
  2. +1 −0 composer.json
  3. +2 −2 docs/en/plugins/bitbucket_notify.md
  4. +1 −1 docs/en/workers/cron.md
  5. +4 −2 public/assets/js/app.js
  6. +6 −6 public/assets/js/build-plugins/loc.js
  7. +1 −1 public/assets/js/build-plugins/phpspec.js
  8. +1 −1 public/assets/js/build-plugins/phptallint.js
  9. +5 −5 public/assets/js/build-plugins/phpunit-coverage.js
  10. +3 −2 public/assets/js/build-plugins/phpunit.js
  11. +1 −1 public/assets/js/build-plugins/summary.js
  12. +1 −3 public/assets/js/build.js
  13. +2 −1 public/assets/js/class.js
  14. +1 −1 public/assets/js/dashboard-widgets/all_projects.js
  15. +1 −1 public/assets/js/dashboard-widgets/build_errors.js
  16. +1 −1 public/assets/js/dashboard-widgets/last_builds.js
  17. +5 −4 src/Application.php
  18. +1 −1 src/BuildFactory.php
  19. +20 −16 src/Builder.php
  20. +3 −2 src/Command/CreateAdminCommand.php
  21. +2 −1 src/Command/CreateBuildCommand.php
  22. +135 −42 src/Command/InstallCommand.php
  23. +1 −1 src/Command/LoggingCommand.php
  24. +5 −5 src/Command/RebuildCommand.php
  25. +3 −3 src/Command/RebuildQueueCommand.php
  26. +10 −9 src/Command/RunCommand.php
  27. +4 −2 src/Command/WorkerCommand.php
  28. +8 −7 src/Console/Application.php
  29. +59 −18 src/Controller/BuildController.php
  30. +17 −13 src/Controller/BuildStatusController.php
  31. +6 −4 src/Controller/GroupController.php
  32. +46 −20 src/Controller/ProjectController.php
  33. +14 −8 src/Controller/SessionController.php
  34. +13 −5 src/Controller/UserController.php
  35. +29 −12 src/Controller/WebhookController.php
  36. +11 −9 src/Controller/WidgetAllProjectsController.php
  37. +6 −5 src/Controller/WidgetBuildErrorsController.php
  38. +3 −3 src/Controller/WidgetLastBuildsController.php
  39. +14 −9 src/Database.php
  40. +1 −1 src/Form/Element/Checkbox.php
  41. +1 −1 src/Form/Element/Select.php
  42. +4 −2 src/Form/Input.php
  43. +1 −1 src/Helper/Bitbucket.php
  44. +3 −2 src/Helper/BuildInterpolator.php
  45. +3 −3 src/Helper/CommandExecutor.php
  46. +3 −1 src/Helper/CommandExecutorInterface.php
  47. +3 −2 src/Helper/Email.php
  48. +1 −1 src/Helper/Github.php
  49. +9 −5 src/Helper/MailerFactory.php
  50. +10 −30 src/Helper/Xml.php
  51. +30 −0 src/Helper/Xml/Utf8CleanFilter.php
  52. +1 −1 src/Logging/BuildDBLogHandler.php
  53. +3 −2 src/Logging/BuildLogger.php
  54. +8 −6 src/Logging/Handler.php
  55. +11 −9 src/Migrations/20151015124825_convert_errors.php
  56. +2 −2 src/Migrations/20180223052715_added_request_branch_to_build.php
  57. +18 −16 src/Model/Base/Build.php
  58. +8 −6 src/Model/Base/BuildError.php
  59. +1 −1 src/Model/Base/BuildMeta.php
  60. +1 −1 src/Model/Base/Environment.php
  61. +7 −5 src/Model/Base/Project.php
  62. +8 −6 src/Model/Base/ProjectGroup.php
  63. +1 −1 src/Model/Base/User.php
  64. +25 −19 src/Model/Build.php
  65. +4 −3 src/Model/Build/BitbucketBuild.php
  66. +5 −5 src/Model/Build/BitbucketServerBuild.php
  67. +3 −2 src/Model/Build/GitBuild.php
  68. +3 −2 src/Model/Build/GithubBuild.php
  69. +3 −2 src/Model/Build/HgBuild.php
  70. +3 −2 src/Model/Build/LocalBuild.php
  71. +3 −2 src/Model/Build/SvnBuild.php
  72. +4 −4 src/Model/Project.php
  73. +1 −1 src/Model/ProjectGroup.php
  74. +2 −1 src/Plugin.php
  75. +7 −6 src/Plugin/BitbucketNotify.php
  76. +2 −1 src/Plugin/Campfire.php
  77. +5 −4 src/Plugin/Codeception.php
  78. +5 −4 src/Plugin/CopyBuild.php
  79. +2 −1 src/Plugin/DeployerOrg.php
  80. +6 −4 src/Plugin/Email.php
  81. +6 −5 src/Plugin/FlowdockNotify.php
  82. +3 −2 src/Plugin/HipchatNotify.php
  83. +2 −1 src/Plugin/Lint.php
  84. +10 −9 src/Plugin/Mage.php
  85. +10 −9 src/Plugin/Mage3.php
  86. +8 −7 src/Plugin/Mysql.php
  87. +12 −11 src/Plugin/Pahout.php
  88. +2 −1 src/Plugin/Pdepend.php
  89. +2 −1 src/Plugin/Pgsql.php
  90. +5 −4 src/Plugin/Phan.php
  91. +3 −2 src/Plugin/Phar.php
  92. +5 −4 src/Plugin/Phing.php
  93. +14 −13 src/Plugin/Phlint.php
  94. +3 −2 src/Plugin/PhpCodeSniffer.php
  95. +3 −2 src/Plugin/PhpCpd.php
  96. +5 −3 src/Plugin/PhpCsFixer.php
  97. +3 −2 src/Plugin/PhpMessDetector.php
  98. +4 −3 src/Plugin/PhpSpec.php
  99. +16 −15 src/Plugin/PhpStan.php
  100. +2 −1 src/Plugin/PhpTalLint.php
  101. +5 −4 src/Plugin/PhpUnit.php
  102. +15 −14 src/Plugin/Psalm.php
  103. +1 −1 src/Plugin/SecurityChecker.php
  104. +5 −3 src/Plugin/SensiolabsInsight.php
  105. +5 −4 src/Plugin/SlackNotify.php
  106. +2 −1 src/Plugin/Sqlite.php
  107. +5 −2 src/Plugin/TechnicalDebt.php
  108. +7 −5 src/Plugin/Telegram.php
  109. +1 −1 src/Plugin/Util/BitbucketNotifyPluginResult.php
  110. +4 −4 src/Plugin/Util/Executor.php
  111. +13 −9 src/Plugin/Util/Factory.php
  112. +3 −1 src/Plugin/Util/PhpUnitResult.php
  113. +5 −3 src/Plugin/Util/PhpUnitResultJson.php
  114. +7 −4 src/Plugin/Util/PhpUnitResultJunit.php
  115. +4 −2 src/ProcessControl/Factory.php
  116. +1 −1 src/Security/Authentication/UserProvider/Ldap.php
  117. +2 −1 src/Security/Authentication/UserProviderInterface.php
  118. +16 −13 src/Service/BuildService.php
  119. +3 −2 src/Service/BuildStatusService.php
  120. +7 −6 src/Service/ProjectService.php
  121. +1 −1 src/Service/UserService.php
  122. +9 −6 src/Store.php
  123. +21 −19 src/Store/BuildErrorStore.php
  124. +3 −2 src/Store/BuildErrorWriter.php
  125. +9 −8 src/Store/BuildMetaStore.php
  126. +39 −37 src/Store/BuildStore.php
  127. +7 −5 src/Store/EnvironmentStore.php
  128. +4 −3 src/Store/ProjectGroupStore.php
  129. +13 −11 src/Store/ProjectStore.php
  130. +8 −7 src/Store/UserStore.php
  131. +3 −2 src/View.php
  132. +2 −2 src/View/Build/errors.phtml
  133. +19 −19 src/View/Build/view.phtml
  134. +6 −6 src/View/BuildStatus/view.phtml
  135. +7 −2 src/View/Form/Checkbox.phtml
  136. +2 −2 src/View/Group/index.phtml
  137. +1 −1 src/View/Home/index.phtml
  138. +22 −23 src/View/Project/ajax-builds.phtml
  139. +6 −3 src/View/Project/edit.phtml
  140. +11 −10 src/View/Project/view.phtml
  141. +6 −2 src/View/Session/login.phtml
  142. +6 −7 src/View/User/index.phtml
  143. +3 −3 src/View/WidgetAllProjects/index-projects.phtml
  144. +1 −1 src/View/WidgetAllProjects/update.phtml
  145. +3 −3 src/View/WidgetBuildErrors/update.phtml
  146. +3 −3 src/View/WidgetLastBuilds/update.phtml
  147. +3 −3 src/View/exception.phtml
  148. +3 −2 src/View/layout.phtml
  149. +2 −1 src/View/pagination.phtml
  150. +3 −3 src/WebController.php
  151. +11 −9 src/Worker/BuildWorker.php
  152. +7 −4 tests/src/Command/CreateAdminCommandTest.php
  153. +8 −6 tests/src/Command/CreateBuildCommandTest.php
  154. +7 −5 tests/src/Command/InstallCommandTest.php
  155. +2 −1 tests/src/Controller/WebhookControllerTest.php
  156. +15 −8 tests/src/DatabaseMysqlTest.php
  157. +15 −8 tests/src/DatabasePostgresqlTest.php
  158. +4 −2 tests/src/FormTest.php
  159. +2 −1 tests/src/Helper/BuildInterpolatorTest.php
  160. +4 −2 tests/src/Helper/CommandExecutorTest.php
  161. +4 −2 tests/src/Helper/EmailTest.php
  162. +2 −1 tests/src/Helper/MailerFactoryTest.php
  163. +4 −2 tests/src/HttpExceptionTest.php
  164. +4 −2 tests/src/Logging/BuildLoggerTest.php
  165. +2 −1 tests/src/Model/Base/BuildErrorTest.php
  166. +6 −4 tests/src/Model/Base/BuildTest.php
  167. +2 −1 tests/src/Model/Base/ProjectGroupTest.php
  168. +2 −1 tests/src/Model/Base/ProjectTest.php
  169. +3 −2 tests/src/Model/BuildTest.php
  170. +3 −2 tests/src/Model/ProjectTest.php
  171. +2 −1 tests/src/Plugin/CopyBuildTest.php
  172. +6 −4 tests/src/Plugin/EmailTest.php
  173. +2 −1 tests/src/Plugin/Option/PhpUnitOptionsTest.php
  174. +3 −2 tests/src/Plugin/PharTest.php
  175. +5 −2 tests/src/Plugin/PhpUnitTest.php
  176. +2 −2 tests/src/Plugin/Util/BitbucketNotifyPluginResultTest.php
  177. +7 −4 tests/src/Plugin/Util/ExecutorTest.php
  178. +6 −4 tests/src/Plugin/Util/FactoryTest.php
  179. +2 −1 tests/src/Plugin/Util/Fake/ExamplePluginWithSingleTypedRequiredArg.php
  180. +5 −3 tests/src/Plugin/Util/PhpUnitResultTest.php
  181. +2 −1 tests/src/PluginTest.php
  182. +5 −2 tests/src/ProcessControl/ProcessControlTest.php
  183. +2 −1 tests/src/Security/Authentication/ServiceTest.php
  184. +2 −1 tests/src/Security/Authentication/UserProvider/InternalTest.php
  185. +9 −6 tests/src/Service/BuildServiceTest.php
  186. +5 −3 tests/src/Service/BuiltStatusServiceTest.php
  187. +5 −4 tests/src/Service/ProjectServiceTest.php
  188. +3 −2 tests/src/Service/UserServiceTest.php
  189. +16 −9 tests/src/StoreMysqlTest.php
  190. +16 −9 tests/src/StorePostgresqlTest.php
  191. +4 −2 tests/src/ViewTest.php
@@ -21,7 +21,5 @@
/public/artifacts
!/public/artifacts/.gitkeep

/public/.htaccess

/tests/runtime
!/tests/runtime/.gitkeep
@@ -49,6 +49,7 @@
"ext-openssl": "*",
"ext-PDO": "*",
"ext-json": "*",
"ext-dom": "*",
"ext-libxml": "*",
"ext-SimpleXML": "*",
"ext-curl": "*",
@@ -11,7 +11,7 @@ Configuration
* **url** [string, required] - URL to Bitbucket.
* **token** [string, required] - $URL/plugins/servlet/access-tokens/manage Your API token.
* **project_key** [string, required] - Your Project Key ($URL/projects/$PROJECT_KEY/repos/$REPOSITORY_SLUG/).
* **respository_slug** [string, required] - Your Respository Slug ($URL/projects/$PROJECT_KEY/repos/$REPOSITORY_SLUG/).
* **repository_slug** [string, required] - Your Repository Slug ($URL/projects/$PROJECT_KEY/repos/$REPOSITORY_SLUG/).
* **create_task_per_fail** [bool, optional] - Create a task per "failed" plugin.
* **create_task_if_fail** [bool, optional] - Create one task if at least one plugin "failed".
* **update_build** [bool, optional] - Update build status in Bitbucket.
@@ -25,7 +25,7 @@ complete:
url: "https://bitbucket.yourhost.de"
token: "123456"
project_key: "test"
respository_slug: "test-service"
repository_slug: "test-service"
create_task_per_fail: true
create_task_if_fail: false
update_build: true
@@ -3,7 +3,7 @@ Run builds using cronjob

-----
**Note: [DEPRECATED]** This functionality is deprecated and will be deleted in version 2.0. Use a
[worker](workers/worker.md) instead.
[worker](worker.md) instead.
-----

Running builds using cron is a quick and simple method of getting up and running with PHP Censor. It also removes the
@@ -93,7 +93,8 @@ var PHPCensor = {

PHPCensor.init();

function handleFailedAjax(xhr) {
function handleFailedAjax(xhr)
{
PHPCensor.handleFailedAjax(xhr);
}

@@ -129,7 +130,8 @@ if (!Function.prototype.bind) {
/**
* Used for delete buttons in the system, just to prevent accidental clicks.
*/
function confirmDelete(url, reloadAfter) {
function confirmDelete(url, reloadAfter)
{

var dialog = new PHPCensorConfirmDialog({
title: Lang.get('confirm_title'),
@@ -9,7 +9,7 @@ var locPlugin = ActiveBuild.UiPlugin.extend({

register: function () {
var self = this;
var query = ActiveBuild.registerQuery('php_loc-data', -1, {num_builds: 10, key: 'php_loc-data'})
var query = ActiveBuild.registerQuery('php_loc-data', -1, {num_builds: 10, key: 'php_loc-data'});

$(window).on('php_loc-data', function (data) {
self.onUpdate(data);
@@ -49,30 +49,30 @@ var locPlugin = ActiveBuild.UiPlugin.extend({
self.chartData = {
labels: [],
datasets: [
{
{
label: Lang.get('lines'),
strokeColor: "#555299",
pointColor: "#555299",
data: []
},
},
{
label: Lang.get('logical_lines'),
strokeColor: "#00A65A",
pointColor: "#00A65A",
data: []
},
},
{
label: Lang.get('comment_lines'),
strokeColor: "#8AA4AF",
pointColor: "#8AA4AF",
data: []
},
},
{
label: Lang.get('noncomment_lines'),
strokeColor: "#00A7D0",
pointColor: "#00A7D0",
data: []
}
}
]
};

@@ -8,7 +8,7 @@ var phpspecPlugin = ActiveBuild.UiPlugin.extend({

register: function () {
var self = this;
var query = ActiveBuild.registerQuery('php_spec-data', -1, {key: 'php_spec-data'})
var query = ActiveBuild.registerQuery('php_spec-data', -1, {key: 'php_spec-data'});

$(window).on('php_spec-data', function (data) {
self.onUpdate(data);
@@ -7,7 +7,7 @@ var phptalPlugin = ActiveBuild.UiPlugin.extend({

register: function () {
var self = this;
var query = ActiveBuild.registerQuery('php_tal_lint-data', -1, {key: 'php_tal_lint-data'})
var query = ActiveBuild.registerQuery('php_tal_lint-data', -1, {key: 'php_tal_lint-data'});

$(window).on('php_tal_lint-data', function (data) {
self.onUpdate(data);
@@ -9,7 +9,7 @@ var coveragePlugin = ActiveBuild.UiPlugin.extend({

register: function () {
var self = this;
var query = ActiveBuild.registerQuery('php_unit-coverage', -1, {num_builds: 10, key: 'php_unit-coverage'})
var query = ActiveBuild.registerQuery('php_unit-coverage', -1, {num_builds: 10, key: 'php_unit-coverage'});

$(window).on('php_unit-coverage', function (data) {
self.onUpdate(data);
@@ -49,24 +49,24 @@ var coveragePlugin = ActiveBuild.UiPlugin.extend({
self.chartData = {
labels: [],
datasets: [
{
{
label: Lang.get('classes'),
strokeColor: "#555299",
pointColor: "#555299",
data: []
},
},
{
label: Lang.get('methods'),
strokeColor: "#00A65A",
pointColor: "#00A65A",
data: []
},
},
{
label: Lang.get('lines'),
strokeColor: "#8AA4AF",
pointColor: "#8AA4AF",
data: []
}
}
]
};

@@ -15,7 +15,7 @@ var phpunitPlugin = ActiveBuild.UiPlugin.extend({

register: function () {
var self = this;
var query = ActiveBuild.registerQuery('php_unit-data', -1, {key: 'php_unit-data'})
var query = ActiveBuild.registerQuery('php_unit-data', -1, {key: 'php_unit-data'});

$(window).on('php_unit-data', function (data) {
self.onUpdate(data);
@@ -127,7 +127,8 @@ var phpunitPlugin = ActiveBuild.UiPlugin.extend({
'<td>' + this.repr(key) + '</td>' +
'<td>=&gt;</td>' +
'<td>' + this.repr(data[key]) + ',</td>' +
'</tr>');
'</tr>'
);
}
}
return '<table>' +
@@ -19,7 +19,7 @@ var SummaryPlugin = ActiveBuild.UiPlugin.extend({

register: function () {
var self = this;
var query = ActiveBuild.registerQuery('plugin-summary', 5, {key: 'plugin-summary'})
var query = ActiveBuild.registerQuery('plugin-summary', 5, {key: 'plugin-summary'});

$(window).on('plugin-summary', function (data) {
self.onUpdate(data);
@@ -59,7 +59,6 @@ var Build = Class.extend({
$('body').removeClass('skin-blue skin-green skin-yellow');
$('body').addClass('skin-red');
break;

}
}
});
@@ -178,8 +177,7 @@ var Build = Class.extend({
css: 'col-xs-12',
box: false,

init: function () {
},
init: function () {},

register: function () {
var self = this;
@@ -47,8 +47,9 @@
// The dummy class constructor
function Class() {
// All construction is actually done in the init method
if (!initializing && this.init)
if (!initializing && this.init) {
this.init.apply(this, arguments);
}
}

// Populate our constructed prototype object
@@ -7,7 +7,7 @@ PHPCensor.widgets.allProjects = {
});
},

load: function() {
load: function () {
$.ajax({
url: APP_URL + 'widget-all-projects',

@@ -7,7 +7,7 @@ PHPCensor.widgets.buildErrors = {
});
},

load: function() {
load: function () {
$.ajax({
url: APP_URL + 'widget-build-errors',

@@ -7,7 +7,7 @@ PHPCensor.widgets.lastBuilds = {
});
},

load: function() {
load: function () {
$.ajax({
url: APP_URL + 'widget-last-builds',

@@ -2,13 +2,14 @@
namespace PHPCensor;
use Exception;
use PHPCensor\Exception\HttpException;
use PHPCensor\Http\Response;
use PHPCensor\Http\Response\RedirectResponse;
use PHPCensor\Store\Factory;
use PHPCensor\Exception\HttpException\NotFoundException;
use PHPCensor\Http\Request;
use PHPCensor\Http\Response;
use PHPCensor\Http\Response\RedirectResponse;
use PHPCensor\Http\Router;
use PHPCensor\Store\Factory;
/**
* @author Dan Cryer <dan@block8.co.uk>
@@ -157,7 +158,7 @@ public function handleRequest()
$response->setResponseCode($ex->getErrorCode());
$response->setContent($view->render());
} catch (\Exception $ex) {
} catch (Exception $ex) {
$this->config->set('page_title', 'Error');
$view = new View('exception');
@@ -2,9 +2,9 @@
namespace PHPCensor;
use PHPCensor\Model\Build;
use PHPCensor\Model\Project;
use PHPCensor\Store\Factory;
use PHPCensor\Model\Build;
/**
* BuildFactory - Takes in a generic "Build" and returns a type-specific build model.

0 comments on commit f99a0e2

Please sign in to comment.
You can’t perform that action at this time.