Skip to content
Merged

ci #72

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
/.gitattributes export-ignore
/.gitignore export-ignore
/.editorconfig export-ignore
/.travis.yml export-ignore
/.styleci.yml export-ignore
/phpunit.xml.dist export-ignore
/tests export-ignore
9 changes: 1 addition & 8 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,6 @@
name: Tests

on:
push:
paths:
- '**.php'
- '.github/workflows/tests.yml'
- 'composer.json'

#on: [pull_request]
on: [pull_request]

jobs:
test:
Expand Down
1 change: 0 additions & 1 deletion .styleci.yml

This file was deleted.

1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
[![Latest Version on Packagist](https://img.shields.io/packagist/v/appstract/laravel-options.svg?style=flat-square)](https://packagist.org/packages/appstract/laravel-options)
[![Total Downloads](https://img.shields.io/packagist/dt/appstract/laravel-options.svg?style=flat-square)](https://packagist.org/packages/appstract/laravel-options)
[![Software License](https://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat-square)](LICENSE.md)
[![Build Status](https://travis-ci.org/appstract/laravel-options.svg?branch=master)](https://travis-ci.org/appstract/laravel-options)

Global key-value store in the database

Expand Down
16 changes: 10 additions & 6 deletions src/Option.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@ class Option extends Model
/**
* Determine if the given option value exists.
*
* @param string $key
* @param string $key
*
* @return bool
*/
public function exists($key)
Expand All @@ -46,8 +47,9 @@ public function exists($key)
/**
* Get the specified option value.
*
* @param string $key
* @param mixed $default
* @param string $key
* @param mixed $default
*
* @return mixed
*/
public function get($key, $default = null)
Expand All @@ -62,8 +64,9 @@ public function get($key, $default = null)
/**
* Set a given option value.
*
* @param array|string $key
* @param mixed $value
* @param array|string $key
* @param mixed $value
*
* @return void
*/
public function set($key, $value = null)
Expand All @@ -80,7 +83,8 @@ public function set($key, $value = null)
/**
* Remove/delete the specified option value.
*
* @param string $key
* @param string $key
*
* @return bool
*/
public function remove($key)
Expand Down
12 changes: 7 additions & 5 deletions src/helpers.php
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
<?php

if (! function_exists('option')) {
if (!function_exists('option')) {
/**
* Get / set the specified option value.
*
* If an array is passed as the key, we will assume you want to set an array of values.
*
* @param array|string $key
* @param mixed $default
* @param array|string $key
* @param mixed $default
*
* @return mixed|\Appstract\Options\Option
*/
function option($key = null, $default = null)
Expand All @@ -24,11 +25,12 @@ function option($key = null, $default = null)
}
}

if (! function_exists('option_exists')) {
if (!function_exists('option_exists')) {
/**
* Check the specified option exits.
*
* @param string $key
* @param string $key
*
* @return mixed
*/
function option_exists($key)
Expand Down
16 changes: 10 additions & 6 deletions tests/Base.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ class Base extends TestCase
/**
* Define environment setup.
*
* @param \Illuminate\Foundation\Application $app
* @param \Illuminate\Foundation\Application $app
*
* @return void
*/
protected function getEnvironmentSetUp($app)
Expand All @@ -20,10 +21,11 @@ protected function getEnvironmentSetUp($app)
$app['config']->set('database.default', 'testbench');

$app['config']->set(
'database.connections.testbench', [
'driver' => 'sqlite',
'database.connections.testbench',
[
'driver' => 'sqlite',
'database' => ':memory:',
'prefix' => '',
'prefix' => '',
]
);
}
Expand All @@ -41,7 +43,8 @@ public function setUp(): void
/**
* Get package providers.
*
* @param \Illuminate\Foundation\Application $app
* @param \Illuminate\Foundation\Application $app
*
* @return array
*/
protected function getPackageProviders($app)
Expand All @@ -54,7 +57,8 @@ protected function getPackageProviders($app)
/**
* Get package aliases.
*
* @param \Illuminate\Foundation\Application $app
* @param \Illuminate\Foundation\Application $app
*
* @return array
*/
protected function getPackageAliases($app)
Expand Down