Skip to content

Commit 8ce410c

Browse files
committed
initial commit
0 parents  commit 8ce410c

File tree

8 files changed

+203
-0
lines changed

8 files changed

+203
-0
lines changed

.gitignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
.php_cs.cache
2+
vendor/
3+
.puli/
4+
puli.json
5+
composer.lock
6+

.php_cs

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
<?php
2+
3+
$header = <<<EOF
4+
This file is part of the laravel-httplug Project.
5+
6+
(c) laravel-httplug <[email protected]>
7+
EOF;
8+
9+
Symfony\CS\Fixer\Contrib\HeaderCommentFixer::setHeader($header);
10+
11+
$finder = Symfony\Component\Finder\Finder::create()
12+
->notPath('bootstrap/cache')
13+
->notPath('storage')
14+
->notPath('vendor')
15+
->in(__DIR__)
16+
->name('*.php')
17+
->ignoreDotFiles(true)
18+
->ignoreVCS(true);
19+
20+
$fixers = [
21+
'header_comment',
22+
'-psr0',
23+
'-php_closing_tag',
24+
'blankline_after_open_tag',
25+
'concat_without_spaces',
26+
'double_arrow_multiline_whitespaces',
27+
'duplicate_semicolon',
28+
'empty_return',
29+
'extra_empty_lines',
30+
'include',
31+
'join_function',
32+
'list_commas',
33+
'multiline_array_trailing_comma',
34+
'namespace_no_leading_whitespace',
35+
'newline_after_open_tag',
36+
'no_blank_lines_after_class_opening',
37+
'no_empty_lines_after_phpdocs',
38+
'object_operator',
39+
'operators_spaces',
40+
'phpdoc_indent',
41+
'phpdoc_no_access',
42+
'phpdoc_no_package',
43+
'phpdoc_scalar',
44+
'phpdoc_short_description',
45+
'phpdoc_to_comment',
46+
'phpdoc_trim',
47+
'phpdoc_type_to_var',
48+
'phpdoc_var_without_name',
49+
'remove_leading_slash_use',
50+
'remove_lines_between_uses',
51+
'return',
52+
'self_accessor',
53+
'single_array_no_trailing_comma',
54+
'single_blank_line_before_namespace',
55+
'single_quote',
56+
'spaces_before_semicolon',
57+
'spaces_cast',
58+
'standardize_not_equal',
59+
'ternary_spaces',
60+
'trim_array_spaces',
61+
'unalign_equals',
62+
'unary_operators_spaces',
63+
'whitespacy_lines',
64+
'multiline_spaces_before_semicolon',
65+
'short_array_syntax',
66+
'short_echo_tag',
67+
];
68+
69+
return Symfony\CS\Config\Config::create()
70+
->level(Symfony\CS\FixerInterface::PSR2_LEVEL)
71+
->fixers($fixers)
72+
->finder($finder)
73+
->setUsingCache(true);

README.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# Laravel-Httplug
2+
3+
4+
5+
## Installation
6+
7+
## Configuration
8+
9+
## Development
10+
11+
#### Attention
12+
*The `./src/Http` directory is named as well cause of Laravel structure, it's not related to Httplug library.*
13+

composer.json

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
{
2+
"name": "php-http/laravel-httplug",
3+
"description": "Laravel package to integrate the Httplug generic HTTP client into Laravel",
4+
"keywords": ["http", "discovery", "adapter", "message", "factory", "bundle", "httplug", "php-http", "laravel"],
5+
"license": "MIT",
6+
"authors": [
7+
{
8+
"name": "Mathieu Santo Stefano--Féron",
9+
"email": "[email protected]"
10+
}
11+
],
12+
"require": {
13+
"illuminate/support": "~5",
14+
"php-http/httplug": "1.*"
15+
},
16+
"minimum-stability": "dev",
17+
"autoload": {
18+
"psr-4": {
19+
"Http\\Httplug\\": "src/"
20+
}
21+
},
22+
"require-dev": {
23+
"phpunit/phpunit": "^5.1",
24+
"fabpot/php-cs-fixer": "^1.11"
25+
}
26+
}

config/laravel-httplug.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<?php
2+
3+
return [
4+
5+
];

src/Httplug.php

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<?php
2+
3+
/*
4+
* This file is part of the laravel-httplug Project.
5+
*
6+
* (c) laravel-httplug <[email protected]>
7+
*/
8+
9+
namespace Http\Httplug;
10+
11+
class Httplug
12+
{
13+
public static function hello()
14+
{
15+
return 'hello';
16+
}
17+
}

src/HttplugFacade.php

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
<?php
2+
3+
/*
4+
* This file is part of the laravel-httplug Project.
5+
*
6+
* (c) laravel-httplug <[email protected]>
7+
*/
8+
9+
namespace Http\Httplug;
10+
11+
use Illuminate\Support\Facades\Facade;
12+
13+
class HttplugFacade extends Facade
14+
{
15+
protected static function getFacadeAccessor()
16+
{
17+
return 'http-httplug';
18+
}
19+
}

src/HttplugServiceProvider.php

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
<?php
2+
3+
/*
4+
* This file is part of the laravel-httplug Project.
5+
*
6+
* (c) laravel-httplug <[email protected]>
7+
*/
8+
9+
namespace Http\Httplug;
10+
11+
use Illuminate\Support\ServiceProvider;
12+
13+
class HttplugServiceProvider extends ServiceProvider
14+
{
15+
/**
16+
* Bootstrap the application events.
17+
*/
18+
public function boot()
19+
{
20+
$this->publishes([
21+
__DIR__.'/../config/laravel-httplug.php' => $this->app->configPath().'/'.'laravel-httplug.php',
22+
], 'config');
23+
}
24+
25+
/**
26+
* Register the service provider.
27+
*/
28+
public function register()
29+
{
30+
$this->mergeConfigFrom(__DIR__.'/../config/laravel-httplug.php', 'laravel-httplug');
31+
32+
$this->app->bind('http-httplug', function () {
33+
return new Httplug();
34+
});
35+
}
36+
37+
/**
38+
* Get the services provided by the provider.
39+
*/
40+
public function provides()
41+
{
42+
return ['laravel-http-httplug'];
43+
}
44+
}

0 commit comments

Comments
 (0)