Passed
Branch develop (bc9545)
by Elvis Henrique
04:21 queued 52s
created

wpsteak.php (1 issue)

Labels
Severity
1
<?php
2
/**
3
 * WP Steak
4
 *
5
 * @package App
6
 *
7
 * Plugin Name: WP Steak
8
 * Description: A fully structured plugin.
9
 * Version: 0.1.0
10
 * Author: Apiki
11
 * Author URI: https://apiki.com/
12
 * Text Domain: wpsteak
13
 * Domain Path: /languages
14
 * Requires PHP: 7.0
15
 */
16
17
use Cedaro\WP\Plugin\PluginFactory;
18
19
if ( file_exists( __DIR__ . '/vendor/autoload.php' ) ) {
20
	require __DIR__ . '/vendor/autoload.php';
21
}
22
23
/**
24
 * Retrieve the main plugin instance.
25
 *
26
 * @return Plugin
0 ignored issues
show
The type Plugin was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
27
 */
28
function wpsteak() {
29
	static $instance;
30
31
	if ( null === $instance ) {
32
		$instance = PluginFactory::create( 'wpsteak' );
33
	}
34
35
	return $instance;
36
}
37
38
$container = new League\Container\Container();
39
40
/* register the reflection container as a delegate to enable auto wiring. */
41
$container->delegate(
42
	( new League\Container\ReflectionContainer() )->cacheResolutions()
43
);
44
45
$plugin = wpsteak();
46
47
$plugin->set_container( $container );
48
$plugin->register_hooks( $container->get( Cedaro\WP\Plugin\Provider\I18n::class ) );
49
50
$config = ( require __DIR__ . '/config.php' );
51
52
foreach ( $config['service_providers'] as $service_provider ) {
53
	$container->addServiceProvider( $service_provider );
54
}
55
56
foreach ( $config['hook_providers'] as $hook_provider ) {
57
	$plugin->register_hooks( $container->get( $hook_provider ) );
58
}
59