42 lines
845 B
Text
42 lines
845 B
Text
global !p
|
|
from mbutils import get_namespace, format_method, map_type, prepare_arguments
|
|
import os
|
|
|
|
def full_path(filename):
|
|
cwd = os.getcwd()
|
|
filepath = os.path.join(cwd, filename)
|
|
|
|
return os.path.dirname(filepath)
|
|
endglobal
|
|
|
|
snippet class
|
|
<?php
|
|
/**
|
|
* @copyright Copyright 2017 ${1:Redbox Digital}
|
|
*/
|
|
|
|
namespace ${2:`!p snip.rv = get_namespace(full_path(path))`};
|
|
|
|
${3:// Use...}
|
|
|
|
class ${4:`!p snip.rv = snip.basename`}${5: extends ${6:ParentClass}}${7: implements ${8:SomeInterface, OtherInterface}}
|
|
\{
|
|
${0:// Implementation...}
|
|
\}
|
|
endsnippet
|
|
|
|
snippet interface
|
|
<?php
|
|
/**
|
|
* @copyright Copyright 2017 ${1:Redbox Digital}
|
|
*/
|
|
|
|
namespace ${2:`!p snip.rv = get_namespace(full_path(path))`};
|
|
|
|
${3:// Use...}
|
|
|
|
interface ${4:`!p snip.rv = snip.basename`}${5: extends ${6:ParentInterface}}
|
|
\{
|
|
${0:// Interface...}
|
|
\}
|
|
endsnippet
|