Skip to content

Commit

Permalink
PHP linting
Browse files Browse the repository at this point in the history
  • Loading branch information
skydiver committed Mar 22, 2018
1 parent a8d6efe commit ab14ffb
Show file tree
Hide file tree
Showing 3 changed files with 79 additions and 77 deletions.
12 changes: 7 additions & 5 deletions src/MaterializeCSS.php
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
<?php

namespace Skydiver\LaravelMaterializeCSS;
namespace Skydiver\LaravelMaterializeCSS;

use Illuminate\Support\Facades\Facade;
use Illuminate\Support\Facades\Facade;

class MaterializeCSS extends Facade {

protected static function getFacadeAccessor() { return 'materialize-css'; }
class MaterializeCSS extends Facade {

protected static function getFacadeAccessor() {
return 'materialize-css';
}

}

?>
104 changes: 52 additions & 52 deletions src/MaterializeCSSBuilder.php
Original file line number Diff line number Diff line change
@@ -1,73 +1,73 @@
<?php

namespace Skydiver\LaravelMaterializeCSS;
namespace Skydiver\LaravelMaterializeCSS;

class MaterializeCSSBuilder {
class MaterializeCSSBuilder {

private static $file_css = '/materialize-css/css/materialize.css';
private static $file_css_min = '/materialize-css/css/materialize.min.css';
private static $file_js = '/materialize-css/js/materialize.js';
private static $file_js_min = '/materialize-css/js/materialize.min.js';
private static $file_jquery = 'jquery-2.1.1.min.js';
private static $file_css = '/materialize-css/css/materialize.css';
private static $file_css_min = '/materialize-css/css/materialize.min.css';
private static $file_js = '/materialize-css/js/materialize.js';
private static $file_js_min = '/materialize-css/js/materialize.min.js';
private static $file_jquery = 'jquery-2.1.1.min.js';


public static function include_full() {
$return = self::include_css();
$return .= self::tag_js('https://code.jquery.com/'.self::$file_jquery);
$return .= self::include_js();
return $return;
}
public static function include_full() {
$return = self::include_css();
$return .= self::tag_js('https://code.jquery.com/'.self::$file_jquery);
$return .= self::include_js();
return $return;
}

public static function include_all() {
$return = self::include_css();
$return .= self::include_js();
return $return;
}
public static function include_all() {
$return = self::include_css();
$return .= self::include_js();
return $return;
}

public static function include_css() {
return self::tag_css(asset(self::$file_css_min));
}
public static function include_css() {
return self::tag_css(asset(self::$file_css_min));
}

public static function include_js() {
return self::tag_js(asset(self::$file_js_min));
}
public static function include_js() {
return self::tag_js(asset(self::$file_js_min));
}

public static function include_secure_css() {
return self::tag_css(secure_asset(self::$file_css_min));
}
public static function include_secure_css() {
return self::tag_css(secure_asset(self::$file_css_min));
}

public static function include_secure_js() {
return self::tag_js(secure_asset(self::$file_js_min));
}
public static function include_secure_js() {
return self::tag_js(secure_asset(self::$file_js_min));
}

public static function get_url_css($full=false, $secure=false) {
if($full == true && $secure == true) {
return secure_asset(self::$file_css_min);
}
if($full == true && $secure == false) {
return asset(self::$file_css_min);
}
return self::$file_css_min;
public static function get_url_css($full=false, $secure=false) {
if($full == true && $secure == true) {
return secure_asset(self::$file_css_min);
}

public static function get_url_js($full=false, $secure=false) {
if($full == true && $secure == true) {
return secure_asset(self::$file_js_min);
}
if($full == true && $secure == false) {
return asset(self::$file_js_min);
}
return self::$file_js_min;
if($full == true && $secure == false) {
return asset(self::$file_css_min);
}
return self::$file_css_min;
}

private static function tag_css($path) {
return '<link rel="stylesheet" charset="utf-8" href="'.$path.'">';
public static function get_url_js($full=false, $secure=false) {
if($full == true && $secure == true) {
return secure_asset(self::$file_js_min);
}

private static function tag_js($path) {
return '<script type="text/javascript" src="'.$path.'"></script>';
if($full == true && $secure == false) {
return asset(self::$file_js_min);
}
return self::$file_js_min;
}

private static function tag_css($path) {
return '<link rel="stylesheet" charset="utf-8" href="'.$path.'">';
}

private static function tag_js($path) {
return '<script type="text/javascript" src="'.$path.'"></script>';
}

}

?>
40 changes: 20 additions & 20 deletions src/MaterializeCSSServiceProvider.php
Original file line number Diff line number Diff line change
@@ -1,31 +1,31 @@
<?php

namespace Skydiver\LaravelMaterializeCSS;
namespace Skydiver\LaravelMaterializeCSS;

use Illuminate\Support\ServiceProvider;
use Illuminate\Support\ServiceProvider;

class MaterializeCSSServiceProvider extends ServiceProvider {
class MaterializeCSSServiceProvider extends ServiceProvider {

protected $defer = true;
protected $defer = true;

public function register() {
$this->publishes([
__DIR__.'/../assets' => public_path('materialize-css'),
], 'materializecss');
$this->registerMaterializeCSSBuilder();
$this->app->alias('materialize-css', 'Skydiver\LaravelMaterializeCSS\MaterializeCSSBuilder');
}

protected function registerMaterializeCSSBuilder() {
$this->app->singleton('materialize-css', function($app) {
return new MaterializeCSSBuilder($app['url']);
});
}
public function register() {
$this->publishes([
__DIR__.'/../assets' => public_path('materialize-css'),
], 'materializecss');
$this->registerMaterializeCSSBuilder();
$this->app->alias('materialize-css', 'Skydiver\LaravelMaterializeCSS\MaterializeCSSBuilder');
}

public function provides() {
return array('materialize-css');
}
protected function registerMaterializeCSSBuilder() {
$this->app->singleton('materialize-css', function ($app) {
return new MaterializeCSSBuilder($app['url']);
});
}

public function provides() {
return array('materialize-css');
}

}

?>

0 comments on commit ab14ffb

Please sign in to comment.