for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php # -*- coding: utf-8 -*-
declare(strict_types=1);
namespace MultisiteGlobalMedia;
/**
* Class Assets
*/
class Assets
{
* @var PluginProperties
private $pluginProperties;
* Assets constructor
*
* @param PluginProperties $pluginProperties
public function __construct(PluginProperties $pluginProperties)
$this->pluginProperties = $pluginProperties;
}
* Enqueue script for media modal
* @since 2015-01-26
public function enqueueScripts()
if ('post' !== get_current_screen()->base) {
get_current_screen()
null
This check looks for function or method calls that always return null and whose return value is used.
class A { function getObject() { return null; } } $a = new A(); if ($a->getObject()) {
The method getObject() can return nothing but null, so it makes no sense to use the return value.
getObject()
The reason is most likely that a function or method is imcomplete or has been reduced for debug purposes.
return;
$scriptFile = '/assets/js/global-media.js';
wp_register_script(
'global_media',
$this->pluginProperties->dirUrl() . $scriptFile,
['media-views'],
filemtime($this->pluginProperties->dirPath() . $scriptFile),
true
);
wp_enqueue_script('global_media');
* @since 2015-02-27
public function enqueueStyles()
$styleFile = '/assets/css/global-media.css';
wp_register_style(
$this->pluginProperties->dirUrl() . $styleFile,
[],
filemtime($this->pluginProperties->dirPath() . $styleFile)
wp_enqueue_style('global_media');
This check looks for function or method calls that always return null and whose return value is used.
The method
getObject()
can return nothing but null, so it makes no sense to use the return value.The reason is most likely that a function or method is imcomplete or has been reduced for debug purposes.