Skip to content
2 changes: 1 addition & 1 deletion Dewdrop/ActivityLog/Handler/Event/ManyToManyMessage.php
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ private function joinListItems(array $shortcodes)
{
if (1 === count($shortcodes)) {
return current($shortcodes);
} else if (2 === count($shortcodes)) {
} elseif (2 === count($shortcodes)) {
return implode(' and ', $shortcodes);
} else {
$lastItem = array_pop($shortcodes);
Expand Down
2 changes: 0 additions & 2 deletions Dewdrop/ActivityLog/Handler/NullHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,10 @@ public function setActivityLog(ActivityLog $activityLog)

public function write($summary, $message)
{

}

public function log($summary, $message)
{

}

public function getName()
Expand Down
1 change: 0 additions & 1 deletion Dewdrop/ActivityLog/Handler/TableHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ public function __construct(Table $table, ActivityLog $activityLog = null, Infle

public function init()
{

}

public function getTable()
Expand Down
2 changes: 0 additions & 2 deletions Dewdrop/Admin/Component/ComponentAbstract.php
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,6 @@ abstract public function init();
*/
public function preDispatch()
{

}

/**
Expand Down Expand Up @@ -372,7 +371,6 @@ public function getName()
{
if (!$this->name) {
$this->name = $this->env->inflectComponentName(basename($this->getPath()));

}

return $this->name;
Expand Down
8 changes: 4 additions & 4 deletions Dewdrop/Admin/Env/Wp.php
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,7 @@ function () use ($component) {

/**
* Registering a component in WordPress means registering a handler
* for a hook. Typically, add_object_page is used, but that implies
* for a hook. Typically, add_menu_page is used, but that implies
* an entry in the top-level admin menu. Because we want to support
* components that don't appear in the menu, we check the display-menu
* permission here and then use add_submenu_page() with no slug to
Expand Down Expand Up @@ -334,15 +334,15 @@ function () use ($component) {
}

/**
* A mock wrapper for WP's add_object_page() function. Allows calls
* A mock wrapper for WP's add_menu_page() function. Allows calls
* during testing without error.
*
* @return void
*/
protected function addObjectPage()
{
if (function_exists('add_object_page')) {
call_user_func_array('add_object_page', func_get_args());
if (function_exists('add_menu_page')) {
call_user_func_array('add_menu_page', func_get_args());
}
}

Expand Down
2 changes: 0 additions & 2 deletions Dewdrop/Admin/Page/PageAbstract.php
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,6 @@ public function shouldProcess()
*/
public function process(ResponseHelper $response)
{

}

/**
Expand All @@ -173,7 +172,6 @@ public function process(ResponseHelper $response)
*/
public function render()
{

}

/**
Expand Down
3 changes: 2 additions & 1 deletion Dewdrop/Admin/Page/Stock/ImportMapFields.php
Original file line number Diff line number Diff line change
Expand Up @@ -294,13 +294,14 @@ private function getFieldValue($id, $mode, array $importRow)
case 'value':
return $this->request->getPost($id);
case 'column':
$column = $this->request->getPost($id . ':column');
$column = $this->request->getPost($id . ':column');

if (isset($importRow[$column])) {
return $importRow[$column];
} else {
return null;
}
// break intentionally omitted
case 'blank':
default:
return null;
Expand Down
1 change: 0 additions & 1 deletion Dewdrop/Admin/Page/Stock/NotificationEdit.php
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,6 @@ public function init()
public function process(ResponseHelper $responseHelper)
{
if ($this->request->isPost()) {

}
}

Expand Down
2 changes: 1 addition & 1 deletion Dewdrop/Admin/Page/Stock/Upload.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public function process(ResponseHelper $response)
if (!$this->request->isPost()) {
$this->error = 'Upload request must be POST.';
return;
} else if (!count($_FILES)) {
} elseif (!count($_FILES)) {
$this->error = 'No file uploads were present. Check form encoding or upload_max_filesize.';
return;
} else {
Expand Down
1 change: 0 additions & 1 deletion Dewdrop/Admin/PageFactory/Custom.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
* @license https://github.com/DeltaSystems/dewdrop/LICENSE
*/

namespace Dewdrop\Admin\Component\ComponentAbstract;
namespace Dewdrop\Admin\PageFactory;

use Dewdrop\Admin\Component\ComponentAbstract;
Expand Down
1 change: 0 additions & 1 deletion Dewdrop/Admin/PageFactory/Files.php
Original file line number Diff line number Diff line change
Expand Up @@ -162,4 +162,3 @@ public function listAvailablePages()
return $pages;
}
}

1 change: 0 additions & 1 deletion Dewdrop/Bootstrap/Standalone.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ public function __construct()

public function init()
{

}

/**
Expand Down
1 change: 0 additions & 1 deletion Dewdrop/Cli/Command/Lint.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,5 @@ public function init()
*/
public function execute()
{

}
}
2 changes: 1 addition & 1 deletion Dewdrop/Db/Driver/DriverInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,7 @@ public function generateCreateIndexStatement($tableName, array $columnNames);

/**
* Generate an SQL statement to analyze a table.
*
*
* @param string $tableName
* @return string
*/
Expand Down
5 changes: 0 additions & 5 deletions Dewdrop/Db/Driver/Mock.php
Original file line number Diff line number Diff line change
Expand Up @@ -245,15 +245,13 @@ public function describeTable($tableName)
*/
public function beginTransaction()
{

}

/**
* Commit the current transaction.
*/
public function commit()
{

}

/**
Expand All @@ -263,7 +261,6 @@ public function commit()
*/
public function rollback()
{

}

/**
Expand Down Expand Up @@ -300,7 +297,6 @@ public function mapNativeTypeToGenericType($nativeType, $length)
*/
public function prepareSelectForTotalRowCalculation(Select $select)
{

}

/**
Expand Down Expand Up @@ -338,7 +334,6 @@ public function getCaseInsensitiveLikeOperator()
*/
public function truncateTimeStampToDate($timestamp)
{

}

/**
Expand Down
2 changes: 1 addition & 1 deletion Dewdrop/Db/Driver/Wpdb.php
Original file line number Diff line number Diff line change
Expand Up @@ -614,7 +614,7 @@ public function truncateTimeStampToDate($timestamp)
*/
public function quoteInternal($input)
{
return "'" . $this->wpdb->escape($input) . "'";
return "'" . esc_sql($input) . "'";
}

/**
Expand Down
1 change: 0 additions & 1 deletion Dewdrop/Db/Row.php
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,6 @@ public function __construct(Table $table, array $data = array())
*/
public function init()
{

}

/**
Expand Down
1 change: 0 additions & 1 deletion Dewdrop/Db/Select.php
Original file line number Diff line number Diff line change
Expand Up @@ -996,7 +996,6 @@ protected function tableCols($correlationName, $cols, $afterCorrelationName = nu
}

if ($columnValues) {

// should we attempt to prepend or insert these values?
if ($afterCorrelationName === true || is_string($afterCorrelationName)) {
$tmpColumns = $this->parts[self::COLUMNS];
Expand Down
2 changes: 1 addition & 1 deletion Dewdrop/Db/Select/Filter/FilterInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,4 @@ interface FilterInterface
* @return Select
*/
public function apply(Select $select, $conditionSetName, array $queryVars);
}
}
1 change: 1 addition & 0 deletions Dewdrop/Db/Select/Filter/Numeric.php
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ public function apply(Select $select, $conditionSetName, array $queryVars)
)
);
}
// break intentionally omitted
case static::OP_IS_LESS_THAN:
if ('' === $op1) {
return $select;
Expand Down
2 changes: 1 addition & 1 deletion Dewdrop/Fields/FieldInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ public function getId();

/**
* Get the name used to represent this field in result sets.
*
*
* @return string
*/
public function getName();
Expand Down
1 change: 0 additions & 1 deletion Dewdrop/Fields/Listing/BulkActions.php
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,6 @@ public function process()
break;
}
}

}

return $result;
Expand Down
1 change: 0 additions & 1 deletion Dewdrop/Fields/Listing/BulkActions/Result.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ public function __construct($result, $message)

$this->result = $result;
$this->message = $message;

}

/**
Expand Down
1 change: 0 additions & 1 deletion Dewdrop/Fields/RowEditor.php
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,6 @@ public function linkRowsToFields()
$modelName,
$link->link($this->getModel($modelName))
);

}
}

Expand Down
1 change: 0 additions & 1 deletion Dewdrop/Fields/Template/Link.php
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,6 @@ function ($content, TableCell $helper, array $rowData, $rowIndex, $columnIndex)

return $node;
}

}
);
}
Expand Down
2 changes: 1 addition & 1 deletion Dewdrop/Paths.php
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ public function getCommands()

/**
* Get the data folder where Dewdrop can write data on the server.
*
*
* @return string
*/
public function getData()
Expand Down
1 change: 0 additions & 1 deletion Dewdrop/Pimple.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ private function __construct()
*/
private function __clone()
{

}

/**
Expand Down
1 change: 0 additions & 1 deletion Dewdrop/Silex/Env.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@ public function bootstrapCli()

public function initializeCli()
{

}

public function initializePimple(Pimple $pimple)
Expand Down
2 changes: 1 addition & 1 deletion Dewdrop/Silex/Service/ControllerInjector.php
Original file line number Diff line number Diff line change
Expand Up @@ -108,4 +108,4 @@ public function register(Application $app)
public function boot(Application $app)
{
}
}
}
1 change: 0 additions & 1 deletion Dewdrop/Test/DomAssertions.php
Original file line number Diff line number Diff line change
Expand Up @@ -66,5 +66,4 @@ public function queryDom($selector, $html)
$query = new DomQuery($html);
return $query->execute($selector);
}

}
2 changes: 1 addition & 1 deletion Dewdrop/Upload/FileHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ public function getValidatorChain()
$uploadFileValidator = new UploadFileValidator();
$this->validatorChain->attach($uploadFileValidator);

if(!empty($this->allowedMimeTypes)) {
if (!empty($this->allowedMimeTypes)) {
$mimeTypeValidator = new MimeTypeValidator();
$mimeTypeValidator->addMimeType($this->allowedMimeTypes);
$this->validatorChain->attach($mimeTypeValidator);
Expand Down
2 changes: 1 addition & 1 deletion Dewdrop/Upload/Filter/ScaleImage.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ public function filter($value)

if ($originalWidth > $originalHeight) {
$image->scaleImage($this->width, 0);
} else if ($originalHeight > $originalWidth) {
} elseif ($originalHeight > $originalWidth) {
$image->scaleImage(0, $this->height);
} else {
$image->scaleImage($this->width, $this->height);
Expand Down
1 change: 0 additions & 1 deletion Dewdrop/View/Helper/BootstrapForm.php
Original file line number Diff line number Diff line change
Expand Up @@ -365,4 +365,3 @@ protected function controlRequiresLabel($output)
|| false !== stripos($output, 'import-edit-control');
}
}

7 changes: 0 additions & 7 deletions Dewdrop/View/Helper/Pagination.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ public function direct($rowCount, $pageSize, $page, $title = 'Records')
$out = '';

if ($rowCount > $pageSize) {

$out .= "<div class=\"page-current-of-all\">Page {$page} of {$pageCount}</div>" .
'<ul class="pagination">';

Expand All @@ -43,26 +42,20 @@ public function direct($rowCount, $pageSize, $page, $title = 'Records')

$j = 0;
for ($i = 1; $i <= $pageCount; $i++) {

$display = false;

if ($page < 7 && $i <= 10) {
// Current page is in the first 6, show the first 10 pages
$display = true;

} elseif ($page > $pageCount - 6 && $i >= $pageCount - 10) {

// Current page is in the last 6, show the last 10 pages
$display = true;

} elseif ($i < 3 || $i > $pageCount - 2 || abs($page - $i) <= 3) {

// Always show the first 2, last 2, and middle 6 pages
$display = true;
}

if ($display) {

if ($j + 1 !== $i) {
// ellipses
$out .= '<li class="disabled"><a href="#">...</a></li>';
Expand Down
2 changes: 1 addition & 1 deletion Dewdrop/View/Helper/Table.php
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ protected function getActiveSortDirection($fieldId, SelectSort $sorter = null)
{
if (!$sorter) {
return ('asc' === $this->view->getRequest()->getQuery('dir') ? 'asc' : 'desc');
} else if ($sorter->isSorted() && $sorter->getSortedField()->getQueryStringId() === $fieldId) {
} elseif ($sorter->isSorted() && $sorter->getSortedField()->getQueryStringId() === $fieldId) {
return strtolower($sorter->getSortedDirection());
}

Expand Down
1 change: 0 additions & 1 deletion Dewdrop/View/View.php
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,6 @@ public function __construct(Escaper $escaper = null, Request $request = null)
*/
public function init()
{

}

/**
Expand Down
Loading