Skip to content

Commit af6c138

Browse files
author
Bastian Schwarz
committed
Added new interface
1 parent de4f074 commit af6c138

1 file changed

Lines changed: 33 additions & 0 deletions

File tree

src/functions/iWithin.php

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
<?php declare(strict_types=1);
2+
/*
3+
* Copyright 2023 Bastian Schwarz <bastian@codename-php.de>.
4+
*
5+
* Licensed under the Apache License, Version 2.0 (the "License");
6+
* you may not use this file except in compliance with the License.
7+
* You may obtain a copy of the License at
8+
*
9+
* http://www.apache.org/licenses/LICENSE-2.0
10+
*
11+
* Unless required by applicable law or agreed to in writing, software
12+
* distributed under the License is distributed on an "AS IS" BASIS,
13+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
* See the License for the specific language governing permissions and
15+
* limitations under the License.
16+
*/
17+
18+
namespace de\codenamephp\deployer\base\functions;
19+
20+
/**
21+
* Interface for the Deployer\within function
22+
*/
23+
interface iWithin {
24+
25+
/**
26+
* Execute a callback within a specific directory and revert back to the initial working directory.
27+
*
28+
* @param string $path The path to execute the callback in
29+
* @param callable():mixed $callback The callback to execute. No parameters and the return value is returned by this function
30+
* @return mixed|null Return value of the $callback function or null if callback throws an exception
31+
*/
32+
public function within(string $path, callable $callback) : mixed;
33+
}

0 commit comments

Comments
 (0)